1 solutions
-
0
C++ :
#include<cstdio> int main() { int n,p=0,t; scanf("%d",&n); printf("%d\n",n); for(int i=1;i<=n;i++) { p++; t=p; if(i%2==1) { for(int j=1;j<=n;j++) if(t>0) { t--; printf("0"); } else { printf("1"); } } else { for(int j=1;j<=n;j++) if(t>0) { t--; printf("1"); } else { printf("0"); } } printf("\n"); } }Pascal :
var n,i,j:longint; a:array[1..500] of longint; begin read(n); writeln(n); for i:=1 to n do begin for j:=1 to n do if i<>j then if a[j]=0 then a[j]:=1 else a[j]:=0; for j:=1 to n do write(a[j]); writeln; end; end.
- 1
Information
- ID
- 17834
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By