Cod sursa(job #236397)
Utilizator | Data | 27 decembrie 2008 13:21:25 | |
---|---|---|---|
Problema | Tije | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <cstdio>
int main()
{
freopen("tije.in","rt",stdin);
freopen("tije.out","wt",stdout);
int N;
scanf("%d",&N);
int step,i,j;
step=N-1;
while( step )
{
i=N;
while( i )
{
j=step;
while( j )
{
printf("%d %d\n",i,i+1);
--j;
}
--i;
}
i=step;
while( i-- )
printf("%d %d\n",N+1,1);
--step;
}
return 0;
}//while() vs for()