Advertisement
Nusrat_Ullah

CF Arabella 2019 C

Jul 12th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int t;
  6.     bool k=false;
  7.     string q,w,re;
  8.     scanf("%d",&t);
  9.     while(t--){
  10.         cin>>w;
  11.         q+=w;
  12.         if(t)q+=' ';
  13.     }
  14.     scanf("%d",&t);
  15.     while(t--){
  16.         cin>>w;
  17.         if(w=="CapsLock"&&!k)k=true;
  18.         else if(w=="CapsLock"&&k)k=false;
  19.         else if(w=="Backspace"&&re.length())re.pop_back();
  20.         else if(w=="Space")re+=" ";
  21.         else if(islower(w[0])&&k)re+=toupper(w[0]);
  22.         else if(islower(w[0])&&!k)re+=w;
  23.     }
  24.     if(q==re)printf("Correct\n");
  25.     else printf("Incorrect\n");
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement