Monday, August 28, 2017

2061 Closing Tabs Uri Problem Only Solution In C#



using System;

public class Test
{
    public static void Main()
    {
    string s=Console.ReadLine();
    string[] values=s.Split(' ');
    int N=int.Parse(values[0]);
    int M=int.Parse(values[1]);
    int count=N;
    for(int i=0;i<M;i++)
    {
        string str=Console.ReadLine();
       
        if(str[0]=='f'){
            count++;
        }
            else{
                count--;
            }
    }
    Console.WriteLine(count);
       
    }   
}

No comments:

Post a Comment