Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t, x=1;
- string pas, in;
- scanf("%d", &t);
- while (t--) {
- cin>>pas>>in;
- printf("Case %d: ", x++);
- if (in==pas) {
- printf("Login successful.\n");
- }
- else {
- printf("Wrong password.");
- string k=in, n=pas, z=pas;
- int d=in.length(), l=pas.length();
- for (int i=0; i<d; i++) {
- if (k[i]>=65 && k[i]<=90)
- k[i]=k[i]+32;
- else if (k[i]>=97 && k[i]<=122)
- k[i]=k[i]-32;
- }
- for (int i=0; i<l; i++) {
- if (n[i]>='0' && n[i]<='9')
- n.erase(n.begin()+i);
- }
- for (int i=0; i<l; i++) {
- if (z[i]>=65 && z[i]<=90)
- z[i]=z[i]+32;
- else if (z[i]>=97 && z[i]<=122)
- z[i]=z[i]-32;
- else if (z[i]>='0' && z[i]<='9')
- z.erase(z.begin()+i);
- }
- if (k==pas) {
- printf(" Please, check your caps lock key.\n");
- }
- else if (n==in) {
- printf(" Please, check your num lock key.\n");
- }
- else if (z==in) {
- printf(" Please, check your caps lock and num lock keys.\n");
- }
- else
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement