Advertisement
a53

Dealuri

a53
Apr 11th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned long long int a[10000];
  7. int i=0;
  8. cin>>a[i];
  9. while(cin>>a[++i]&&a[i]!=0)
  10. {
  11. if(a[i]<a[i-1])
  12. {
  13. for(int j=i-1;j>=0;--j)
  14. cout<<a[j]<<' ';
  15. a[0]=a[i],i=0;
  16. }
  17. }
  18. for(int j=i-1;j>=0;--j)
  19. cout<<a[j]<<' ';
  20. cout<<'\n';
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement