20110915_260 @ 2023-08-06 10:20:56
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int n,a[500],m;
int main(){
cin>>n;
for(int i=1;i<=n*2;i++)
cin>>a[i];
for(int i=1;i<=n*2;i++){
if(i%2==0){
for(int j=1;j<=a[i];j++){
cout<<1;
m++;
if(m==n) {
cout<<"\n";
m=0;
}
}
}else{
for(int j=1;j<=a[i];j++){
cout<<0;
m++;
if(m==n){
cout<<"\n";
m=0;
}
}
}
}
return 0;
}
by dthythxth_Huge_Brain @ 2023-08-06 10:37:03
@20110915_260 题目里仿佛没有说对应的压缩码个数是
by dthythxth_Huge_Brain @ 2023-08-06 10:39:24
这里要用while循环
by 20110915_260 @ 2023-08-06 10:39:26
@Huge_Brain 那要咋整???
by 20110915_260 @ 2023-08-06 10:41:06
while的条件要怎么写??
by 20110915_260 @ 2023-08-06 10:44:29
@Huge_Brain 写对了,谢谢~