SHARE
TWEET

Untitled

delvinkrasniqi Jan 24th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int size,A[size] , i , j , tmp;
  7.    
  8.     cout <<"Shenoni gjatesine e vargut : ";
  9.     cin >> size;
  10.    
  11.     cout <<"Sheno elementet : " <<endl;
  12.    
  13.     for (int i=0;i<size;i++)
  14.     {
  15.         cin >> A[i];
  16.     }
  17.    
  18.     // Sortimi
  19.    
  20.     for (int i=0;i<size;i++)
  21.     {
  22.         for (j=i+1;j<size;j++)
  23.         {
  24.             if (A[i]>A[j])
  25.             {
  26.                 tmp=A[i];
  27.                 A[i]=A[j];
  28.                 A[j]=tmp;
  29.             }
  30.         }
  31.     }
  32.    
  33.     // Vargu i sortuar
  34.    
  35.     for (int i=0;i<size;i++)
  36.     {
  37.         cout << A[i] << " ";
  38.     }
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top