Advertisement
remote87

tangensi manii

Sep 17th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Globalization;
  7.  
  8. namespace TestPrograms
  9. {
  10.     class TestPrograms
  11.     {
  12.         static void Main()
  13.         {
  14.             int x = int.Parse(Console.ReadLine());
  15.             int y = int.Parse(Console.ReadLine());
  16.             string[] r = Math.Sqrt((x * x) + (y * y)).ToString("0.0000000").Split('.');
  17.             double angle = Math.Atan2(y, x);
  18.             double radians = angle * (180 / Math.PI);
  19.  
  20.  
  21.             Console.WriteLine(r[0] + "." + r[1].Substring(0, 4));
  22.             Console.WriteLine("{0:0.0000}", radians);
  23.         }
  24.        
  25.     }
  26.    
  27.          
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement