코딩로그
[백준/BOJ/C++] 15178번 Angles 본문
[문제]
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";
}
}
[결과 화면]
'YJ > C++' 카테고리의 다른 글
[백준/BOJ/C++] 12525번 Centauri Prime (Small1) (0) | 2021.11.05 |
---|---|
[백준/BOJ/C++] 4606번 The Seven Percent Solution (0) | 2021.11.05 |
[백준/BOJ/C++] 13297번 Quick Estimates (0) | 2021.11.05 |
[백준/BOJ/C++] 9947번 Coin tossing (0) | 2021.11.05 |
[백준/BOJ/C++] 9948번 Have you had your birthday yet? (0) | 2021.11.02 |