結果

問題 No.346 チワワ数え上げ問題
ユーザー HimatsubushinHimatsubushin
提出日時 2016-03-08 13:35:18
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 796 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 107,124 KB
実行使用メモリ 30,440 KB
最終ジャッジ日時 2024-09-24 13:42:14
合計ジャッジ時間 4,690 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 10 TLE * 1 -- * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No346
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = 0;
            string word = "cww";
            string text = Console.ReadLine();

            for (int i = 0; i < text.Length; i++)
            {
                if (text[i] == word[0])
                {
                    for (int j = i + 1; j < text.Length; j++)
                    {
                        if (text[j] == word[1])
                        {
                            for (int k = j + 1; k < text.Length; k++)
                                if (text[k] == word[2])
                                    num++;
                        }
                    }
                }
            }

            Console.WriteLine(num);
        }
    }
}
0