Friday, August 25, 2017

2006 Identifying Tea URI Problem Only Solution In C#

using System; 
 class Exercise8 

    static void Main()
   
    {
       int T=Convert.ToInt32(Console.ReadLine());
       string s=Console.ReadLine();
       string[] values=s.Split(' ');
       int count=0;
       int A=int.Parse(values[0]);
       if(A==T)
       {
           count++;
       }
       int B=int.Parse(values[1]);
       if(B==T)
       {
           count++;
       }
       int C=int.Parse(values[2]);
       if(C==T)
       {
           count++;
       }
       int D=int.Parse(values[3]);
       if(D==T)
       {
           count++;
       }
       int E=int.Parse(values[4]);
       if(E==T)
       {
           count++;
       }
       Console.WriteLine(count);
    }

}

No comments:

Post a Comment