Guest User

Untitled

a guest
Feb 11th, 2019
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.    
  9.     char answer[n];
  10.    
  11.     //get input
  12.     for(int i=0; i<n; i++) {
  13.         cin >> answer[i];
  14.     }
  15.    
  16.     int count = 0;
  17.    
  18.     for(int i=0; i<n; i++) {
  19.         char c;
  20.         cin >> c;
  21.         if(c == answer[i]) {
  22.             count++;
  23.         }
  24.     }
  25.    
  26.     cout << count;
  27.    
  28.     return 0;
  29. }
Add Comment
Please, Sign In to add comment