Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

게임 개발 메모장

14. 분노 유발자 본문

문제 해결력 훈련

14. 분노 유발자

Dev_Moses 2024. 1. 8. 16:00

#include <iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;

	int Max = 0;
	int Count = 0;
	int IndexCount = -1;
	int Students[101] = {0,};

	for (int i = 0; i < n; ++i)
	{
		cin >> Students[i];
		++IndexCount;
	}

	for (int i = 0; Students[i] != '\0'; ++i)
	{
		Max = Students[i];

		bool IsCount = true;

		if (i == IndexCount)
		{
			break;
		}

		for (int j = i + 1; Students[j] != '\0'; ++j)
		{
			if (Max < Students[j])
			{
				IsCount = false;
				break;
			}
		}

		if (IsCount == true)
		{
			IsCount = true;
			Count++;
		}
	}

	cout << Count << endl;
}

'문제 해결력 훈련' 카테고리의 다른 글

16. 카드 게임  (0) 2024.01.08
15. 가위 바위 보  (1) 2024.01.08
13. 층간 소음  (0) 2024.01.08
12. 선생님 퀴즈  (0) 2024.01.08
11. 아나그램  (0) 2024.01.08