3 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int l=s.size(); for(int i=0;i<l;i++) { if(s[i]==',') continue; int j=i; while(j<l&&s[j]!=',') j++; j--; string s1=s.substr(i,j-i+1); bool f=true; if(s1.size()<6||s1.size()>12) { f=false; } //cout<<f<<endl; bool c1=0,c2=0,c3=0,c4=0; int s4=0; for(int i=0;i<s1.size();i++) { if(s1[i]>='A'&&s1[i]<='Z') { c1=1; } else if(s1[i]>='a'&&s1[i]<='z') { c2=1; } else if(s1[i]>='0'&&s1[i]<='9') { c3=1; } else if(s1[i]=='@'||s1[i]=='!'||s1[i]=='#'||s1[i]=='$') { c4=1; } else{ f=false; } } //cout<<c1<<" "<<c2<<" "<<c3<<" "<<f<<endl; s4=c1+c2+c3; if((s4>=2&&c4>=1)&&f) { cout<<s1<<endl; } i=j; } return 0; }
Information
- ID
- 1179
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 45
- Accepted
- 11
- Uploaded By