본문 바로가기
  • Let's study
PS/백준

[C++] 백준 11257: IT Passport Examination

by 코딩고수이고파 2023. 5. 8.

문제

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

 

11257번: IT Passport Examination

บรรทัดแรก เป็นจํานวนเต็ม N ระบุจํานวนผู้สอบ และ N บรรทัด ต่อมาเป็นข้อมูลของผู้เข้าสอบแต่ละค

www.acmicpc.net

 

해결방법

전력 점수35 * 0.3 이상이고, 관리 점수25 * 0.3 이상이고, 기술 점수40 * 0.3 이상이고 전체 점수55 이상이면 PASS 아니면 FAIL을 출력한다.

 

코드

#include<iostream>

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, a, b, c, d;
	cin >> n;

	while (n--) {
		cin >> a >> b >> c >> d;

		cout << a << ' ' << b + c + d << ' ';

		if (b >= 35 * 0.3 && c >= 25 * 0.3 && d >= 40 * 0.3 && b + c + d >= 55)
			cout << "PASS\n";
		else
			cout << "FAIL\n";
	}

	return 0;
}

'PS > 백준' 카테고리의 다른 글

[C++] 백준 5300: Fill the Rowboats!  (0) 2023.05.10
[C++] 백준 5357: Dedupe  (0) 2023.05.09
[C++] 백준 3765: Celebrity jeopardy  (0) 2023.05.07
[C++] 백준 21638: SMS from MCHS  (0) 2023.05.06
[C++] 백준 24072: 帰省 (Homecoming)  (0) 2023.05.05

댓글