Cod sursa(job #404202)
Utilizator | Data | 25 februarie 2010 21:24:52 | |
---|---|---|---|
Problema | Tablete | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 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++)
{ fprintf(g,"%d ",x);
x++;
}
fprintf(g,"\n");
}
}
return 0;
}