Advertisement
Batisk_AFF

tail-3

Oct 16th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("a = ");
  14.             double a = Double.Parse(Console.ReadLine());
  15.             Console.Write("b = ");
  16.             double b = Double.Parse(Console.ReadLine());
  17.  
  18.             double y;
  19.             if(b > 1)
  20.             {
  21.                 y = (a*(Math.Sqrt(a*a + b*b)))/b;
  22.             }
  23.             else
  24.             {
  25.                 if (Math.Sqrt(a*a + b*b) < 3)
  26.                 {
  27.                     y = -a;
  28.                 }
  29.                 else y = -b;
  30.             }
  31.  
  32.             Console.WriteLine("Program output:\ny = {0}", y);
  33.         }
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement