Saleh127

Live archive 5047

Jul 27th, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long int
  4. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  5. string number(string x)
  6. {
  7. ll l= x.size();
  8. string w;
  9. for(ll i = 0; i < l; i++)
  10. {
  11. if(x[i] >= '0' && x[i] <= '9') continue;
  12. else w+= x[i];
  13. }
  14. return w;
  15. }
  16.  
  17. string capsCheck(string z)
  18. {
  19. ll ln = z.size();
  20. string ans;
  21. for(ll i = 0; i < ln; i++)
  22. {
  23. if(z[i] >= 'a' && z[i] <= 'z') ans +=(z[i]-32);
  24. else if(z[i] >= 'A' && z[i] <= 'Z') ans +=(z[i]+32);
  25. else ans += z[i];
  26. }
  27. return ans;
  28. }
  29.  
  30. int main()
  31. {
  32. ll t,j;
  33. cin>>t;
  34. for(j=1; j<=t; j++)
  35. {
  36. string a,c,d;
  37. cin >>a >>c;
  38. cout << "Case " << j << ": ";
  39.  
  40. d.clear();
  41. d = number(a);
  42. if(a == c) cout << "Login successful." << endl;
  43. else if(d == c) cout << "Wrong password. Please, check your num lock key." << endl;
  44. else if(capsCheck(a) == c) cout << "Wrong password. Please, check your caps lock key." << endl;
  45. else if(capsCheck(d) == c) cout << "Wrong password. Please, check your caps lock and num lock keys." << endl;
  46. else cout << "Wrong password." << endl;
  47. }
  48.  
  49. return 0;
  50.  
  51. }
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment