Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("a = ");
- double a = Double.Parse(Console.ReadLine());
- Console.Write("b = ");
- double b = Double.Parse(Console.ReadLine());
- double y;
- if(b > 1)
- {
- y = (a*(Math.Sqrt(a*a + b*b)))/b;
- }
- else
- {
- if (Math.Sqrt(a*a + b*b) < 3)
- {
- y = -a;
- }
- else y = -b;
- }
- Console.WriteLine("Program output:\ny = {0}", y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement