Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // wczytaj długość ciągu
- Consol.WriteLine("Podaj długość ciągu:");
- int n= int.Parse(Console.ReadLine());
- int[] tablica = new int[n];
- for (int i=0; i < n; i++);
- {
- Console.WriteLine("Podaj kolejny element ciągu: ");
- tablica[i] = int.Parse(Console.ReadLine());
- }
- for (int j = 0; j < n; j++)
- {
- for (int i = 0; i < n - j - 1; i++)
- {
- if (tablica[i] = int > tablica[i + 1])
- {
- int x = tablica[i];
- tablica[i] = tablica[i + 1];
- tablica[i + 1] = x;
- {
- }
- foreach (var item in tablica);
- {
- Console.Write(item + " ");
- }
- Console.WriteLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement