Notice
Recent Posts
Recent Comments
Link
«   2025/08   »
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
관리 메뉴

코딩로그

[백준/BOJ/C++] 15178번 Angles 본문

YJ/C++

[백준/BOJ/C++] 15178번 Angles

Team DAON 2021. 11. 5. 14:26

[문제]

Angela is teaching her primary school pupils how to use a protractor (which hopefully you know is a device used to measure angles!). She has given each pupil a set of triangles and asked them to measure and record each of the three internal angles.

Angela would like you to write a simple program to check her pupil s results. Knowing that the internal angles of a triangle add up to 180º, which results should Angela check?

[입력]

You will be given a set of results from one class. It will start with a single integer, N, the number of pupils who have supplied readings. (0 < N <= 30). There will then follow N lines, each containing 3 positive integers separated by spaces. The numbers represent the measurements supplied by a pupil for the 3 angles of a triangle.

[출력]

For each set of readings, output the numbers as input followed by the word Check if they do not add up to 180, or Seems OK if they do.

[Source Code]

#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

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

	for(int i = 0; i < test; i++){
		int a, b, c;
		cin >> a >> b >>c;
		cout << a << " " << b << " " << c << " ";
		if(a+b+c == 180)
			cout << "Seems OK\n";
		else
			cout << "Check\n";
	}
}

[결과 화면]