Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Съобщение от georgimalchev2009@gmail.com
- Среден 3
- Първо трябва да се направи проверката if(a>c) и след това if(b>c)
- за да са в намаляващ ред трябва да се обърне знака при сравняване или да се изведът в обратен ред
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace project_izpitvane
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //sortirane na tri chisla ot golqmo kum malko
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int c = int.Parse(Console.ReadLine());
- if (a>b)
- {
- int x = a;
- a = b;
- b = x;
- }
- if (b>c)
- {
- int x = b;
- c = b;
- c = x;
- }
- if (a>c)
- {
- int x = c;
- c = a;
- a = x;
- }
- Console.WriteLine($"{a},{b},{c}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement