Pagini recente » Cod sursa (job #682842) | Cod sursa (job #321260) | Cod sursa (job #301863) | Cod sursa (job #1460808) | Cod sursa (job #2749424)
#include <fstream>
#include <list>
using namespace std;
ifstream f("schi.in");
ofstream g("schi.out");
list <int> schiori;
int aux, n, x;
list<int>::iterator it;
int main()
{
f >> n;
for (int i = 1; i <= n; i++) {
f >> x;
it = schiori.begin();
aux = 0;
while (aux < x-1) {
aux++;
it++;
}
schiori.insert(it, i);
}
for (auto it = schiori.begin(); it != schiori.end(); it++)
g << *it << "\n";
}