Advertisement
Farjana_akter

Untitled

Feb 3rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. char a[100],b[100],c[100],d[100],e[100];
  7. int t,i,j,k,l;
  8. cin>>t;
  9. for(l=1;l<=t;l++)
  10. {
  11. scanf("%s %s",a,b);
  12. if(strcmp(a,b)==0){
  13. cout<<"Case "<<l<<": "<<"Login successful."<<endl;
  14. continue;
  15. }
  16. for(i=0;i<strlen(a);i++)
  17. {
  18. if(a[i]>=65 && a[i]<=90)
  19. c[i]=a[i]+32;
  20. else if(a[i]>=97 && a[i]<=122)
  21. c[i]=a[i]-32;
  22. }
  23. if(strcmp(c,b)==0){
  24. cout<<"Case "<<l<<": "<<"Wrong password. Please, check your caps lock key."<<endl;
  25. continue;}
  26. for(i=0;i<strlen(a);i++)
  27. {
  28. if(a[i]>='0' && a[i]<='9')
  29. continue;
  30. else
  31. d[i]=a[i];
  32. }
  33. if(strcmp(d,b)==0){
  34. cout<<"Case "<<l<<": "<<"Wrong password. Please, check your num lock key."<<endl;
  35. continue;}
  36. for(i=0;i<strlen(a);i++)
  37. {
  38. if(a[i]>=65 && a[i]<=90)
  39. e[i]=a[i]+32;
  40. else if(a[i]>=97 && a[i]<=122)
  41. e[i]=a[i]-32;
  42. else if(a[i]>='0' && a[i]<='9')
  43. continue;
  44. else
  45. e[i]=a[i];
  46. }
  47. if(strcmp(e,b)==0){
  48. cout<<"Case "<<l<<": "<<"Wrong password. Please, check your caps lock and num lock keys."<<endl;
  49. continue;}
  50. else
  51. cout<<"Case "<<l<<": "<<"Wrong password."<<endl;
  52.  
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement