why WA
查看原帖
why WA
1297817
yuhaosheng楼主2024/6/25 19:05
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	getline(cin,s);
    int n=s.size();
    s[n]=',';
	int m=0;
    for(int i=0;i<=n;i++){
    	if(s[i]==','){
    		int l=0;
    		int l1=0;
    		int x=0,d=0,shu=0,t=0;
    		for(int j=m;j<i;j++){
    			l++;
    			if(!((s[j]>='0'&&s[j]<='9')||(s[j]>='A'&&s[j]<='Z')||(s[j]>='a'&&s[j]<='z')||s[j]=='!'||s[j]=='@'||s[j]=='#'||s[j]=='$')){
    				l1++;
				}
				if(s[j]>='0'&&s[j]<='9'){
					shu++; 
				}
				if(s[j]>='A'&&s[j]<='Z'){
					d++;
				}
				if(s[j]>='a'&&s[j]<='z'){
					x++;
				}
				if(s[j]=='!'||s[j]=='@'||s[j]=='#'||s[j]=='$'){
					t++;
				}
			}
			if(l1==0&&l>=6&&l<=12&&(shu>0&&d>0||d>0&&x>0||shu>0&&x>0||shu>0&&d>0&&x>0)&&t>0){
				for(int j=m;j<i;j++){
    			    cout<<s[j]; 
			    }
                cout<<endl;
				m=i+1;
			}
		}
	}
	return 0;
}
2024/6/25 19:05
加载中...