Cod sursa(job #2563030)

Utilizator valentinchipuc123Valentin Chipuc valentinchipuc123 Data 29 februarie 2020 21:49:54
Problema Tije Scor 50
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.35 kb
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;

short n;
ifstream f("tije.in");
ofstream g("tije.out");
int main()
{
f>>n;
for(short i=1;i<=n-1;i++)
 {
  for(short j=n;j>=1;j--)
   {
    for(short z=1;z<=i;z++)
     g<<j<<" "<<j+1<<endl;
   }
  for(short z=1;z<=i;z++)
     g<<n+1<<" "<<"1"<<endl;
 }
}