howellxie @ 2024-12-22 14:56:57
#include <bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
for (int i=0;i<=a.size();++i){
if (a[i]==','||i==a.size()){
if (i-1>=6&&i-1<=12){
int cnta=0,cntb=0;
for (int j=0;j<i;++j){
if ((a[j]>='a'&&a[j]<='z'||a[j]>='A'&&a[j]<='Z'||a[j]>='0'&&a[j]<='9')==false){
if ((a[j]=='!'||a[j]=='@'||a[j]=='#'||a[j]=='$')==false){
break;
}
}
if (a[j]>='a'&&a[j]<='z'||a[j]>='A'&&a[j]<='Z'||a[j]>='0'&&a[j]<='9'){
++cnta;
}
if (a[j]=='!'||a[j]=='@'||a[j]=='#'||a[j]=='$'){
++cntb;
}
if (cnta>1&&cntb>0){
for (int k=0;k<i;++k){
cout<<a[k];
}
cout<<endl;
}
}
}
}
}
return 0;
}