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 CSharp___4
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите 2 числа");
- int x = Convert.ToInt16(Console.ReadLine());
- int y = Convert.ToInt16(Console.ReadLine());
- //float x1 = x;
- //float y1 = y;
- if (x == y)
- {
- Console.WriteLine("Это равные числа");
- }
- //else if (x1 > y1)
- //{
- // y1 = (x1 + y1) / 2;
- // x1 += (y1 * 2);
- //}
- //else if (x1 < y1)
- //{
- // x1 = (x1 + y1) / 2;
- // y1 = x1 * y1 * 2;
- //}
- else if (x > y)
- {
- y = (x + y) / 2;
- x += (y * 2);
- }
- else if (x < y)
- {
- x = (x + y) / 2;
- y = x * y * 2;
- }
- Console.WriteLine("x = " + x);
- Console.WriteLine("y = " + y);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement