Pagini recente » Cod sursa (job #2516050) | Cod sursa (job #2229790) | Borderou de evaluare (job #528036) | Cod sursa (job #2232934) | Cod sursa (job #2171223)
#include <iostream>
#include <fstream>
using namespace std;
fstream fin("perm2.in", ios::in);
fstream fout("perm2.out", ios::out);
int n, perm[105], k;
int x[3][105];
void Read() {
fin >> n;
for(int i=1; i<=n; i++) {
x[1][i]=i;
fin >> x[2][i];
}
}
bool Ok(int v[105]) {
int j=0, contor;
for(contor=1; contor<=n && j==0; contor++) {
if(v[contor]!=contor)
j=1;
}
if(j==0 && contor==n)
return false;
return true;
}
int Permutare() {
while(Ok(perm)) {
}
}
int main()
{
Read();
fout << Permutare();
return 0;
}