Saturday, August 26, 2017

DCP-14: Box Devskill Problem Only Solution In C#

https://www.devskill.com/CodingProblems/ViewProblem/14

using System; 

 public class Exercise8 


     public static void Main()
   
     {
   

        int T=Convert.ToInt32(Console.ReadLine());

        for(int i=0;i<T;i++){
           
            string s=Console.ReadLine();
            string[] values=s.Split(' ');
            double a=double.Parse(values[0]);
            double b=double.Parse(values[1]);
            double c=double.Parse(values[2]);
           
            double r=(a*a)+(b*b)+(c*c);
           
            double ans=Math.Pow(r,0.5);

            Console.WriteLine(ans.ToString("0.00"));
        }
   
     }

}

No comments:

Post a Comment