求调
查看原帖
求调
1218138
molakeser楼主2024/9/17 10:46
#include <bits/stdc++.h>

using namespace std;
#define int long long

string s,s1;
bool tj1(string s){
	for(int i=0;i<s.size();i++){
		if(!isalnum(s[i])&&s[i]!='!'&&s[i]!='@'&&s[i]!='#'&&s[i]!='$')
			return 0;
	}
	return 1;
}
bool tj2(string s){
	if(s.size()<6||s.size()>12)
		return 0;
	return 1;
}
bool tj3(string s){
	int t1=0,t2=0,t3=0;
	for(int i=0;i<=s.size();i++){
		if(isalpha(s[i]))
			t1=1;
		if(isdigit(s[i]))
			t2=1;
		if(s[i]=='!'||s[i]=='@'||s[i]=='#'||s[i]=='$')
			t3=1;
	}
	if(t1+t2>=2&&t3)
		return 1;
	return 0;
}
signed main(){
	cin>>s;
	for(int i=0;i<s.size();i++){
		char c=s[i];
		if(c!=','){
			s1+=c;
		}
		if(i==s.size()-1||c==','){
			if(tj1(s1)&&tj2(s1)&&tj3(s1))
				cout<<s1<<endl;
			s1="";
		}
	}
	return 0;
}
2024/9/17 10:46
加载中...