Advertisement
a53

Sort10

a53
May 13th, 2022
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int comp(int a,int b)
  5. {
  6. return a>b;
  7. }
  8.  
  9. int main()
  10. {
  11. int n;
  12. cin>>n;
  13. int nr,v[n+1],lv=0;
  14. bool ok=false;
  15. for(int i=1;i<=n;++i)
  16. {
  17. cin>>nr;
  18. if(nr%10==0)
  19. v[lv++]=nr,ok=true;
  20. }
  21. if(ok)
  22. {
  23. sort(v,v+lv,comp);
  24. for(int i=0;i<lv;++i)
  25. cout<<v[i]<<' ';
  26. }
  27. else
  28. cout<<"NU EXISTA";
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement