알고리즘/SW Expert Academy

[D3] 9317. 석찬이의 받아쓰기

혬혬 2020. 3. 8. 20:01
728x90
#include<stdio.h>
#include<iostream>
using namespace std;
int main(void) {
	int tc = 0;
	cin >> tc;
	for (int i = 0; i < tc; i++) {
		string a;
		string b;
		int s_l = 0;
		cin >> s_l;
		cin >> a;
		cin >> b;
		int count = 0;
		for (int j = 0; j < s_l; j++) {
			if (a[j] == b[j])
				count++;
		}
		cout <<"#"<<i+1<<" "<< count<<endl;
	}
	return 0;
}

 

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AW-hOY5KeEIDFAVg&categoryId=AW-hOY5KeEIDFAVg&categoryType=CODE

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

728x90