#include<bits/stdc++.h>
using namespace std;
const int N = 100;
bitset<N+1>ans[N+1];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
bitset<N+1>temp = 0;
ans[1][1] = 1;
for(int i = 2;i <= N;i++){
if(i&1)ans[i][N] = 1;
else{
for(int j = 2;j <= N;j++)ans[i][j] = 1;
}
}
for(int i = 1;i <= N;i++){
for(int j = 1;j <= N;j++){
cout << ans[i][j];
}
cout << "\n";
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include<bits/stdc++.h> using namespace std; const int N = 100; bitset<N+1>ans[N+1]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); bitset<N+1>temp = 0; ans[1][1] = 1; for(int i = 2;i <= N;i++){ if(i&1)ans[i][N] = 1; else{ for(int j = 2;j <= N;j++)ans[i][j] = 1; } } for(int i = 1;i <= N;i++){ for(int j = 1;j <= N;j++){ cout << ans[i][j]; } cout << "\n"; } } |
English