백준 10807 c++

magicdrill·2024년 3월 25일

백준 문제풀이

목록 보기
207/673

백준 10807 c++

#include <iostream>
using namespace std;

int main(void)
{
	int arr[100];
	int num, i, target, total = 0;

	cin >> num;
	if (num >= 1 && num <= 100)
	{
		for (i = 0; i < num; i++)
		{
			cin >> arr[i];
		}
	}
	else
	{
		;
	}
	cin >> target;
	if (target >= -100 && target <= 100)
	{
		for (i = 0; i < num; i++)
		{
			if (target == arr[i])
			{
				total++;
			}
			else
			{
				;
			}
		}
	}
	else
	{
		;
	}
	cout << total << endl;

	return 0;
}

0개의 댓글