백준 3052 c++

magicdrill·2024년 3월 18일
0

백준 문제풀이

목록 보기
165/655

백준 3052 c++

#include <iostream>
using namespace std;
int main(void)
{
	int arr[10] = {};
	int temp;

	for (int i = 0; i < 10; i++)
	{
		cin >> temp;
		if (temp > 0 && temp < 1000)
		{
			arr[i] = temp % 42;
		}
		else
		{
			i--;
		}
	}

	temp = 1;
	for (int i = 1; i < 10; i++)
	{
		for (int j = 0; j < i; j++)
		{
			if (arr[i] == arr[j])
			{
				break;
			}
			else if(j == i-1)
			{
				temp++;
			}
			else
			{
				;
			}
		}
	}
	cout << temp << endl;
	return 0;
}

0개의 댓글