Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 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 CSharp___4
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Введите 2 числа");
  14. int x = Convert.ToInt16(Console.ReadLine());
  15. int y = Convert.ToInt16(Console.ReadLine());
  16. //float x1 = x;
  17. //float y1 = y;
  18. if (x == y)
  19. {
  20. Console.WriteLine("Это равные числа");
  21. }
  22. //else if (x1 > y1)
  23. //{
  24. // y1 = (x1 + y1) / 2;
  25. // x1 += (y1 * 2);
  26.  
  27. //}
  28. //else if (x1 < y1)
  29. //{
  30. // x1 = (x1 + y1) / 2;
  31. // y1 = x1 * y1 * 2;
  32. //}
  33. else if (x > y)
  34. {
  35. y = (x + y) / 2;
  36. x += (y * 2);
  37.  
  38. }
  39. else if (x < y)
  40. {
  41. x = (x + y) / 2;
  42. y = x * y * 2;
  43. }
  44. Console.WriteLine("x = " + x);
  45. Console.WriteLine("y = " + y);
  46. Console.ReadKey();
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement