周六3级GESPc++
  • 板块灌水区
  • 楼主N_ty
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/12/4 20:40
  • 上次更新2023/12/5 08:42:04
查看原帖
周六3级GESPc++
1104615
N_ty楼主2023/12/4 20:40

这里在做9月的题,不知道为什么输出0001,找不出原因 是2023GESP3级c++的题

这道题

#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	int n;
	ll b = 1, c = 1, d = 1;
	ll s = 1;
	cin >> n;
	while (n--) {
		string a;
		cin >> a;

		ll len = a.size();

		for (int i = 0; i < len; i++) {

			ll s = 1, b = 1, c = 1, d = 1;

			if (a[i] != 0 && a[i] != 1) s = 0;
			if (a[i] > 3) b = 0;
			if (a[i] > 8) c = 0;
			if (a[i] >= 'A' && a[i] <= 'Z') {
				b = 0, c = 0, s = 0;
				break;
			}


		}
		cout << s << " " << b << " " << c << " " << d << endl;
	}
	return 0;
}
2023/12/4 20:40
加载中...