Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- struct Emplacement {
- int emplacement;
- int marchand;
- bool operator<(const Emplacement& e) const
- {
- return (marchand < e.marchand);
- }
- };
- int main(void)
- {
- int nbMarchands;
- cin >> nbMarchands;
- Emplacement emplacements[nbMarchands];
- for(int emplacement = 0; emplacement < nbMarchands; emplacement++)
- {
- int marchand;
- cin >> marchand;
- emplacements[emplacement].marchand = marchand;
- emplacements[emplacement].emplacement = emplacement;
- }
- sort(emplacements, emplacements+nbMarchands);
- for(int marchand=0; marchand < nbMarchands; marchand++)
- cout << emplacements[marchand].emplacement << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement