40分,求过、
查看原帖
40分,求过、
1512308
qinmingluogu楼主2025/7/30 08:35

帮帮我啊


#include<bits/stdc++.h> 
using namespace std;
string a;
int main(){
    int d=0,x=0,s=0,t=0,y=0,b=0;
	  cin>>a;
	for(int i=0;i<a.size();i++)
	{
		if(b==0)
		{
			if(a[i]==',')
			{
				if(d+x+s>=2)
				{
					if(t==1)
					{
						for(int j=y;j<i;i++)
						{
							cout<<a[j];
						}
						cout<<endl;
					}
				}
				d=0;
				x=0;
				s=0;
				t=0;
				y=i+1;
				b=0;
		    }
		}
		else
		{
		    if(a[i] <= 'Z' && a[i] >= 'A')
		    {
		    	d=1;
			}
			else if(a[i] <= 'z' && a[i] >= 'a')
			{
				x=1;
			}
			else if(a[i] <= '9' && a[i] >= '0')
			{
				s=1;
			}
			else if(a[i] == '!' || a[i] == '$' || a[i] == '@' || a[i] == '#')
			{
				t=1;
			} 
			else
			{
				b=1;
			}
		}
	} 
}
2025/7/30 08:35
加载中...