|
|
вернуться в форумWhy I have TL? Послано enick 23 мар 2008 18:17 #include <stdio.h> //#include <stdlib.h> int main() { int a[100][100]; int f,flag,i,j,k,n,N,E; scanf("%d",&N); E=0; i=-1; j=N; flag=0; while (E<N*N+1) { if (flag==1) { j--; } else i++; n=j; k=i; while (k>=0&&n>=1) { ++E; a[k][n]=E; k--;n--; } if (i>=N-1) flag=1; } for (i=0;i<N;i++) { for (j=1;j<=N;j++) printf("%d ",a[i][j]); printf("\n"); } return 0; } Re: Why I have TL? #include <stdio.h> //#include <stdlib.h> int main() { int a[100][100]; int f,flag,i,j,k,n,N,E; scanf("%d",&N); E=0; i=-1; j=N; flag=0; while (E<N*N+1) { if (flag==1) { j--; } else i++; n=j; k=i; while (k>=0&&n>=1) { ++E; a[k][n]=E; k--;n--; } if (i>=N-1) flag=1; } for (i=0;i<N;i++) { for (j=1;j<=N;j++) printf("%d ",a[i][j]); printf("\n"); } return 0; } IT IS DONT TRUE Re: Why I have TL? I got AC. |
|
|