10pt。。。
查看原帖
10pt。。。
317400
Foggy_night楼主2023/7/3 23:18
#include<iostream>
using namespace std;
int a[205]; 
int main(){
	int n, x = 1, s = 0;
	bool flag = false;
	cin >> n;
	while(cin >> a[x++]);
	for(int i = 1; i <= x; i++){
		s += a[i];
		if(s > n){
			s %= n;
			if(s == 0)
				cout << endl;
			for(int j = 1; j <= a[i]-s; j++)
				if(flag == false)
					cout << 0;
				else cout << 1;
				
			cout << endl; 
			
			for(int j = 1; j <= s; j++){
				if(flag == false)
					cout << 0;
				else cout << 1;
			}	
		}
		else {
			for(int j = 1; j <= a[i]; j++){
				if(flag == false)
					cout << 0;
				else cout << 1;
			}	
		}
		if(!flag) flag = true;//修改01,true则为1,false则为0 
		else flag = false;
	}
	return 0;
}
2023/7/3 23:18
加载中...