본문 바로가기

BOJ

[백준] 10807번 개수 세기 c++

#include <bits/stdc++.h>
using namespace std;

int main(void) {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int arr[101] = {};
	int num;
	int count = 0;
	cin >> num;
	for (int i = 0; i < num; i++) {
		cin >> arr[i];
	}
	int find;
	cin >> find;
	for (int i = 0; i < num; i++) {
		if (arr[i] == find)
			count++;
	}
	cout << count;
}

'BOJ' 카테고리의 다른 글

[백준] 1475번 방 번호 c++  (0) 2020.04.21
[백준] 13300 방 배정 c++  (0) 2020.04.20
[백준] 10808번 알파벳 개수 C++  (0) 2020.04.20
[백준] 2309번 일곱 난쟁이 c++  (0) 2020.04.20
[백준] 10804번 카드 역배치 c++  (0) 2020.04.19