大lao们求助
查看原帖
大lao们求助
1278268
Song_jiayu楼主2024/10/26 22:20

不输出提示 return value 3221226356

#include<bits/stdc++.h>
using namespace std;
string s,t;
long long f;
int u,l,n,o;
/*1.大写字母 2.小写字母 3.数字 0~9 4.其他字符*/ 
int oc1,oc2,oc3,oc4;
/*1.大写开关 2.小写开关 3.数字开关 4.其他开关*/ 
int main(){
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]!=','){
			t[i]=s[i];
		}else{
			oc1=oc2=oc3=oc4=0;
			for(int j=0;j<t.size();j++){
				if(t[j]>='A' and t[j]<='Z'){
					oc1=1;
					u++;
				}else if(t[j]>='a' and t[j]<='z'){
					oc2=1;
					l++;
				}else if(t[j]>='0' and t[j]<='9'){
					oc3=1;
					n++;
				}else if(t[j]=='!' or t[j]=='@' or t[j]=='#' or t[j]=='$'){
					oc4=1;
					o++;
				}else{
					f=1;
					break;
				}
			}
			if(f==0 and oc1+oc2+oc3>=2 and oc4==1){
				if(u+l+n+o>=6 and u+l+n+o<=12){
					cout<<t<<"\n";
				}
			}
			t="";
		}
	}
	return 0;
}

2024/10/26 22:20
加载中...