Cod sursa(job #2575706)

Utilizator valentinchipuc123Valentin Chipuc valentinchipuc123 Data 6 martie 2020 15:06:05
Problema Tije Scor 95
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<<'\n';
   }
  for(short z=1;z<=i;z++)
     g<<n+1<<" "<<"1"<<'\n';
 }
}