Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int[] tomb = new int[10];
- Random r = new Random();
- for (int i = 0; i < tomb.Length; ++i)
- {
- tomb[i] = r.Next(100);
- Console.Write(tomb[i] + " ");
- }
- Console.WriteLine();
- //Rendezes
- for (int a = 0; a < tomb.Length; ++a)
- {
- for (int b = 0; b < tomb.Length; ++b)
- {
- if (tomb[b] > tomb[a])
- {
- int c = tomb[a];
- tomb[a] = tomb[b];
- tomb[b] = c;
- }
- }
- }
- for (int i = 0; i < tomb.Length; ++i)
- {
- Console.Write(tomb[i] + " ");
- }
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement