dev能运行但是洛谷编译失败有没有大佬帮帮
  • 板块P1319 压缩技术
  • 楼主zq1one
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/3/15 18:45
  • 上次更新2024/3/15 18:46:49
查看原帖
dev能运行但是洛谷编译失败有没有大佬帮帮
1084455
zq1one楼主2024/3/15 18:45
#include<bits/stdc++.h>
using namespace std;

int n,number,k;
string s;
bool flag=false;

int main(){
	cin>>n;
	while((cin>>s)!=0){
		number=s[0]-'0';
		for(int i=0;i<number;i++){
			if(flag==false){
				cout<<"0";
			}else
			{
				cout<<"1";
			}
			k++;
			if(k%n==0){
				cout<<endl;
				k=0;
			}
			if(flag==false){
				flag=true;
			}else
			{
				flag=false;
			}
		}
	}
	return 0;
}
2024/3/15 18:45
加载中...