2 solutions
-
0
#include <bits/stdc++.h> using namespace std; bool isTrue(string s){ int l=s.length(); if(l<6||l>12) return false; int xxzm=0,dxzm=0,sz=0,zf=0; for(int i=0;i<l;i++){ if(s[i]>='a'&&s[i]<='z') xxzm++; if(s[i]>='A'&&s[i]<='Z') dxzm++; if(s[i]>='0'&&s[i]<='9') sz++; if(s[i]=='!'||s[i]=='@'||s[i]=='#'||s[i]=='$') zf++; } if(xxzm+dxzm+sz+zf!=l) return false; if(((xxzm&&dxzm)||(xxzm&&sz)||(sz&&dxzm))&&zf) return true; else return false; } int main(){ string s,a=""; cin>>s; s=s+','; for(int i=0;i<s.length();i++){ if(s[i]!=','){ a+=s[i]; } else{ if(isTrue(a)) cout<<a<<endl; a=""; } } return 0; }
Information
- ID
- 64
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 7
- Tags
- # Submissions
- 30
- Accepted
- 8
- Uploaded By