tanasaradu

Untitled

Nov 13th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int a[1001],b[1001],n;
  5. int main()
  6. {
  7. int j;
  8. cin>>n;
  9. for(int i=1;i<=n;i++)
  10. {
  11. cin>>a[i];
  12. b[i]=a[i];
  13. }
  14. sort(b+1,b+n+1);
  15. for(int i=1;i<=n;i++)
  16. {
  17. cout<<b[i]<<" ";
  18. for(j=1;j<=n && a[j]!=b[i];j++)
  19. ;
  20. cout<<j<<" ";
  21. a[j]=1001;
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment