Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include <string>
- #include <iostream> //cout, cin
- using namespace std;
- int main() {
- string id;
- cin>>id;
- int len = id.length();
- int upper =0;
- int lower = 0;
- int number = 0;
- if(len< 8){
- cout<<"Not Accept";
- exit(0);
- }
- for(int i=0; i<len; i++){
- if((id[i] <= 'z' && id[i] >= 'a') ){
- lower++;
- }
- if((id[i] <= 'Z' && id[i] >= 'A') ){
- upper++;
- }
- if((id[i] <= '9' && id[i] >= '0') ){
- number++;
- }
- }
- if (lower == 0 || upper ==0 || number == 0){
- cout<<"Not Accept";
- exit(0);
- }
- if(!(id[len-1] !='@' || id[len-1] !='$' || id[len-1] !='#' || id[len-1] !='&')){
- cout<<"Not Accept";
- exit(0);
- }
- cout<< "Accept";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement