Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<string>
- using namespace std;
- int main()
- {
- string str1,str2,str3,str4,str5;
- int n;
- freopen("input.txt","r",stdin);
- cin>>n;
- for(int i=1;i<=n;i++){
- cin>>str1>>str2;
- cout<<"Case "<<i<<": ";
- if(str1==str2)
- cout<<"Login successful."<<endl;
- else{
- cout<<"Wrong password.";
- str3=str1;
- str4=str1;
- str5=str1;
- int j=0;
- while(j<str1.size()){
- if(str5[j]>='a' && str5[j]<='z')
- str5[j]=(str5[j]-'a')+'A';
- else if(str5[j]>='A' && str5[j]<='Z')
- str5[j]=(str5[j]-'A')+'a';
- j++;
- }
- j=0;
- while(j<str3.size()){
- if(str3[j]>='0' && str3[j]<='9'){
- str3.erase(str3.begin()+j);
- str4.erase(str4.begin()+j);
- }
- else{
- if(str4[j]>='a' && str4[j]<='z')
- str4[j]=(str4[j]-'a')+'A';
- else if(str4[j]>='A' && str4[j]<='Z')
- str4[j]=(str4[j]-'A')+'a';
- j++;
- }
- }
- if(str5==str2)
- cout<<" Please, check your caps lock key.";
- else if(str3==str2)
- cout<<" Please, check your num lock key.";
- else if(str4==str2)
- cout<<" Please, check your caps lock and num lock keys.";
- cout<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement