Cod sursa(job #404206)

Utilizator kyrkDragos Dumitrescu kyrk Data 25 februarie 2010 21:26:46
Problema Tablete Scor 10
Compilator cpp Status done
Runda pcon3 Marime 0.33 kb
#include<stdio.h>
int main()
{
FILE *f=fopen("tablete.in","r"), *g=fopen("tablete.out","w");
int n,k,i,x,j;
fscanf(f,"%d %d",&n,&k);
if((k%2)==0)
{   x=1;
    for(i=1;i<=n;i++)
      for(j=1;j<=n;j++)
        {  if(j==n)fprintf(g,"%d\n",x);
           else fprintf(g,"%d ",x);
           x++;
        }
}

return 0;
}