Advertisement
nikitta_e

Георги Марчев

Dec 17th, 2024
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Съобщение от georgimalchev2009@gmail.com
  2. Среден 3
  3. Първо трябва да се направи проверката if(a>c) и след това if(b>c)
  4. за да са в намаляващ ред трябва да се обърне знака при сравняване или да се изведът в обратен ред
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10.  
  11. namespace project_izpitvane
  12. {
  13. internal class Program
  14. {
  15. static void Main(string[] args)
  16. {
  17. //sortirane na tri chisla ot golqmo kum malko
  18. int a = int.Parse(Console.ReadLine());
  19. int b = int.Parse(Console.ReadLine());
  20. int c = int.Parse(Console.ReadLine());
  21. if (a>b)
  22. {
  23. int x = a;
  24. a = b;
  25. b = x;
  26. }
  27.  
  28. if (b>c)
  29. {
  30. int x = b;
  31. c = b;
  32. c = x;
  33. }
  34.  
  35.  
  36.  
  37. if (a>c)
  38. {
  39. int x = c;
  40. c = a;
  41. a = x;
  42. }
  43. Console.WriteLine($"{a},{b},{c}");
  44. }
  45. }
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement