Thursday, August 24, 2017

2143 The Return of Radar URI Problem Only Solution In C#


using System; 

 class Exercise8


   
 
     static void Main()
    
    {
       
    while(true)
    {
         int tst=Convert.ToInt32(Console.ReadLine());
         if(tst==0)
         {
             break;
         }
        for(int i=1; i<=tst; i++)
        {
            int n=Convert.ToInt32(Console.ReadLine());
            if(n%2!=0) Console.WriteLine( n*2-1);
            else Console.WriteLine(n*2-2);
        }
    }
    }
   
}

No comments:

Post a Comment