40分,求调
查看原帖
40分,求调
1382224
Iain_楼主2024/8/10 11:57
#include<bits/stdc++.h>
using namespace std;
void eleven(int a,int b){
	int c=a/11;
	for(int i=c;i>0;i--){
		cout<<11<<":"<<b/11<<endl;
		if(b>=11)b/=11;
	}
	cout<<a-11*c<<":"<<b<<endl; 
}
void twentytwo(int a,int b){
	int c=a/21;
	for(int i=c;i>0;i--){
		cout<<21<<":"<<b/21<<endl;
		if(b>=21)b/=21;
	}
	cout<<a-21*c<<":"<<b<<endl; 
} 
int main(){
//	freopen("in.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
	char c;
	int w=0,l=0;
	for(int i=0;c!='E';i++){ 
		cin>>c;
		if(c=='W')w++;else if(c=='L') l++;
	} 
	eleven(w,l);
	cout<<endl;
	twentytwo(w,l);
	return 0;
}

2024/8/10 11:57
加载中...