SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
#include <iostream>
using namespace std;
int N;
string str1, str2;
int getResult() {
int result = 0;
for(int i=0; i<N; i++) {
if(str1[i] == str2[i]) result++;
}
return result;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tc; cin >> tc;
for(int i=1; i<=tc; i++) {
cin >> N >> str1 >> str2;
cout << '#' << i << ' ' << getResult() << '\n';
}
return 0;
}
'알고리즘 > SWEA' 카테고리의 다른 글
[SWEA] 8673. 코딩 토너먼트1 (0) | 2020.03.17 |
---|---|
[SWEA] 1220. [S/W 문제해결 기본] 5일차 - Magnetic (0) | 2020.02.24 |
[SWEA] 8457. 알 덴테 스파게티 (0) | 2020.02.17 |
[SWEA] 8888. 시험 (0) | 2020.02.16 |
[SWEA] 9229. 한빈이와 Spot Mart (0) | 2020.02.15 |
댓글