70分求助
查看原帖
70分求助
1066396
szm111213楼主2024/6/9 09:56
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x1=getchar(),x2=getchar(),x3=getchar(),x4=getchar(),k;
	cin >> k;
	if(x1>=k) x1%=k;
	if(x2>=k) x2%=k;
	if(x3>=k) x3%=k;
	if(x4>=k) x4%=k;
	if(x1=='0' && x2!='0') cout << x2 << x3 << x4 << endl;
	else if(x1=='0' && x2=='0' && x3!='0') cout << x3 << x4 << endl;
	else if(x1=='0' && x2=='0' && x3=='0' && x4!='0') cout << x4 << endl;
	else if(x1=='0' && x2=='0' && x3=='0' && x4=='0') cout << 0 << endl;
	else if(x1!='0') cout << x1 << x2 << x3 << x4 << endl;
	return 0;
}
2024/6/9 09:56
加载中...