Cod sursa(job #2171223)

Utilizator RaduVFVintila Radu-Florian RaduVF Data 15 martie 2018 11:35:42
Problema Generare de permutari Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.64 kb
#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;
}