HELP!! 0pts
查看原帖
HELP!! 0pts
1459937
abssortpow1145145楼主2024/11/25 19:15
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a,t="";
    cin >> a;
    a+=',';
    for(int i=0;i<a.size();i++)
    {
    	if(a[i]==',')
    	{
    		int flag=1;
    		if(t.size()<6 || t.size()>12)
    		{
    			flag=0;
			}
			int s=0,d=0,x=0,te=0;
			for(int j=0;j<t.size();j++)
			{
				if(a[j]>='0' && a[j]<='9')
				{
					s=1;
				}
				else if(a[j]>='A' && a[j]<='Z')
				{
					d=1;
				}
				else if(a[j]>='a' && a[j]<='z')
				{
					x=1;
				}
				else if(a[j]=='!' || a[j]=='@' || a[j]=='#' || a[j]=='$')
				{
					te=1;
				}
				else
				{
					flag=0;
				}
			}
			if(s+d+x>=2 && flag==1 && te==1)
			{
				cout << t << endl;
			}
		}
		else
		{
			t+=a[i];
		}
	}
    return 0;
}
2024/11/25 19:15
加载中...