Advertisement
Alx09

Untitled

Apr 9th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include<ctime>
  3. #include<stdlib.h>
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9. string nume[]={"Alin","Florin","Bogdan","Sever"};
  10. int ok;
  11.  
  12. do{
  13. ok = 1;
  14. for(int i=0;i<=2;i++)
  15. if(nume[i] > nume[i+1])swap(nume[i],nume[i+1]),ok = 0;
  16.  
  17.  
  18. }while(!ok);
  19. for(int i=0;i<=3;i++) cout <<nume[i]<<' ';
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement