Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- char answer[n];
- //get input
- for(int i=0; i<n; i++) {
- cin >> answer[i];
- }
- int count = 0;
- for(int i=0; i<n; i++) {
- char c;
- cin >> c;
- if(c == answer[i]) {
- count++;
- }
- }
- cout << count;
- return 0;
- }
Add Comment
Please, Sign In to add comment