Submission #1189794


Source Code Expand

using System;
class A{static void Main()
{
int a=int.Parse(Console.ReadLine());
for(int i=0;i<a;i++)
{
string s=Console.ReadLine();if(s.Length>=5){int ans=0;
for(int i=0;i<s.Length-5;i++)
{
string d=s.Substring(i,5);
if(d=="tokyo"||d=="kyoto"){ans++;i+=4;}
}Console.WriteLine(ans);
}else{Console.WriteLine("0");}
}
}}

Submission Info

Submission Time
Task A - 東京都
User rayhotate
Language C# (Mono 4.6.2.0)
Score 0
Code Size 331 Byte
Status CE

Compile Error

./Main.cs(8,9): error CS0136: A local variable named `i' cannot be declared in this scope because it would give a different meaning to `i', which is already used in a `parent or current' scope to denote something else