fork download
  1. #include <iostream>
  2. using namespace std;
  3. const int N=5;
  4. void sortuj(int A[])
  5. {
  6. for(int i=1;i<N;i++)
  7. for(int j=0;j<N-1;j++)
  8. if(A[j]>A[j+1]) swap(A[j],A[j+1]);
  9. }
  10. int main()
  11. {
  12. int A[5]={13,16,11,10,19};
  13. for(int i=0;i<N;i++)
  14. cout<<A[i]<<" ";
  15. sortuj(A);
  16. for(int i=1;i<N;i++)
  17. cout<<A[i]<<" ";
  18. return 0;
  19. }
  20.  
  21.  
  22.  
  23.  
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
13 16 11 10 19 11 13 16 19