Advertisement
cupsamada

sortare 618

Feb 20th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. pair <int,int> v[1005];
  5. int main()
  6. {
  7. int i,n;
  8. cin>>n;
  9. for(i=1;i<=n;i++)
  10. {
  11. cin>>v[i].first;
  12. v[i].second=i;
  13. }
  14. sort(v+1,v+n+1);
  15. for(i=1;i<=n;i++)
  16. {
  17. cout<<v[i].second<<" ";
  18. }
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement