样例过了,但是0分,求调
查看原帖
样例过了,但是0分,求调
745329
Masked_fool楼主2024/4/5 16:04
#include<bits/stdc++.h>
using namespace std;
bool checkc(char c){
	if(c>='a' and c<='z') return true;
	if(c>='A' and c<='Z') return true;
	if(c>='0' and c<='9') return true;
	if(c=='!' or c=='@' or c=='#' or c=='$') return true;
}
bool checks(string s){
	int l=s.length();
	if(l<6 or l>12) return false;
	for(int i=0;i<l;i++) if(checkc(s[i])==false) return false; 
	return true;
}
int main(){
	string lin="";bool p=true;char c;
	while(cin>>c){
		if(c==','){
			if(checks(lin)==true) cout<<lin<<endl;
			lin=""; 
			continue; 
		}
		else lin+=c;
	}
	return 0;
}
2024/4/5 16:04
加载中...