试运行都是对的,为什么WA呢???
查看原帖
试运行都是对的,为什么WA呢???
1532278
DCG_201145楼主2025/1/5 16:41
#include<bits/stdc++.h>
using namespace std;
int main(){
	string test;
	cin >> test;
	test += ',';
	int n = test.length();
	int last = 0;
	for (int i = 0;i < n;i++){
		string one;
		if (test[i] == ','){
			one = test.substr(last,i-last);
			last = i+1;int none = one.length();
			if (none < 6 || none > 12){
				continue;
			}
			int tw = 0;
			for (int j = 0;j < none;j++){
				if ((one[j] == '!' || one[j] == '$') || (one[j] == '#' || one[j] == '@')) tw += 114514;
				else if(('a' <= one[j] && one[j] <= 'z') || ('A' <= one[j] && one[j] <= 'Z')) tw += 114514;
				else if('0' <= one[j] && one[j] <= '9') tw += 114514;
			}
			if (tw == 114514 * none) cout << one <<endl;
		}
	}
	return 0;
}
2025/1/5 16:41
加载中...