본문 바로가기
Computer Science

석찬이의 받아쓰기

by OKOK 2019. 2. 12.

1. 문자 비교

2. 끝 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
 
const int MAXN = 15;
char gstr[MAXN + 1];
char sstr[MAXN + 1];
int tc, T, N, ans;
 
int main(void)
{
    freopen("input.txt""r", stdin);
    for (tc = scanf("%d"&T); tc <= T; ++tc, ans = 0)
    {
        scanf("%d"&N);
        scanf("%s", gstr);
        scanf("%s", sstr);
        for (int i = 0; i < N; ++i) ans += (gstr[i] == sstr[i]);
        printf("#%d %d\n", tc, ans);
    }
    return 0;
}
cs

 


'Computer Science' 카테고리의 다른 글

세상의 모든 팰린드롬 2  (0) 2019.02.13
초콜릿과 건포도  (0) 2019.02.12
배열의 분할  (0) 2019.02.12
재미있는 오셀로 게임  (0) 2019.02.12
러시아 국기 같은 깃발  (0) 2019.02.12

댓글