nicuvlad76

92

Oct 25th, 2020
456
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. #define N 1005
  3. using namespace std;
  4. ifstream fin("proiecte.in");
  5. ofstream fout("proiecte.out");
  6. int n;
  7. struct  pa
  8. {
  9.     int x,y;
  10. } v[N];
  11.  
  12. bool comp(pa a, pa b)
  13. {
  14.     return a.x<b.x;
  15. }
  16. int main()
  17. {
  18.     fin>>n;
  19.     for(int i=1; i<=n; i++)
  20.     {
  21.         fin>>v[i].x;
  22.         v[i].y=i;
  23.     }
  24.     sort(v+1,v+n+1,comp);
  25.     for(int i=1; i<=n; i++)
  26.       fout<<v[i].y<<' ';
  27.     return 0;
  28. }
  29.  
RAW Paste Data