Advertisement
Guest User

Untitled

a guest
Nov 29th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. // wczytaj długość ciągu
  2.             Consol.WriteLine("Podaj długość ciągu:");
  3.             int  n= int.Parse(Console.ReadLine());
  4.  
  5.            
  6.             int[] tablica = new int[n];
  7.  
  8.            
  9.             for (int i=0; i < n; i++);
  10.             {
  11.                 Console.WriteLine("Podaj kolejny element ciągu: ");
  12.                 tablica[i] = int.Parse(Console.ReadLine());
  13.                
  14.             }
  15.             for (int j = 0; j < n; j++)
  16.             {
  17.                 for (int i = 0; i < n - j - 1; i++)
  18.                 {
  19.  
  20.             if (tablica[i] = int > tablica[i + 1])
  21.             {
  22.                 int x = tablica[i];
  23.                 tablica[i] = tablica[i + 1];
  24.                 tablica[i + 1] = x;
  25.  
  26.     {
  27.          
  28.     }
  29.            
  30.             foreach (var item in tablica);
  31.             {
  32.                 Console.Write(item  + " ");
  33.  
  34.              
  35.             }
  36.             Console.WriteLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement