Cod sursa(job #1879090)

Utilizator GoogalAbabei Daniel Googal Data 14 februarie 2017 18:28:31
Problema Tije Scor 85
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("tije.in");
ofstream fout("tije.out");

int n;

int main()
{
    int i,j,k;
    fin>>n;
    fin.close();
    for(i=n-1; i>0; i--)
    {
        for(j=n; j>0; j--)
            for(k=1; k<=i; k++)
                fout<<j<<' '<<j+1<<'\n';
        for(k=1; k<=i; k++)
            fout<<n+1<<' '<<1<<'\n';
    }
    fout.close();
    return 0;
}