본문 바로가기

Coding/백준 온라인 저지 (Baekjoon Online Judge)

백준 온라인 저지(Baekjoon Online Judge) - 25640 : MBTI

https://www.acmicpc.net/problem/25640

 

25640번: MBTI

진호는 요즘 유행하는 심리 검사인 MBTI에 관심이 많다. MBTI는 아래와 같이 네 가지 척도로 사람들의 성격을 구분해서, 총 $16$가지의 유형중에서 자신의 유형을 찾을 수 있는 심리 검사이다. 내향(

www.acmicpc.net

 

#include <iostream>
#include <string>
using namespace std;

int main() {
	string str;
	cin >> str;
	int n;
	cin >> n;
	string* arr = new string[n];
	int count = 0;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		if (str == arr[i])
			count++;
	}
	cout << count;
}