#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
long long int T; scanf("%lld", &T);
for (int i = 0; i < T; i++) {
long long int num1, num2, result;
char cacul, equal;
scanf("%lld %c %lld %c %lld", &num1, &cacul, &num2, &equal, &result);
if (cacul == '+') {
if (num1 + num2 == result) printf("correct\n");
else printf("wrong answer\n");
}
else if (cacul == '-') {
if (num1 - num2 == result) printf("correct\n");
else printf("wrong answer\n");
}
else if (cacul == '*') {
if (num1 * num2 == result) printf("correct\n");
else printf("wrong answer\n");
}
else if (cacul == '/') {
if (num1 / num2 == result) printf("correct\n");
else printf("wrong answer\n");
}
}
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 1357๋ฒ - ๋ค์งํ ๋ง์ (0) | 2021.11.04 |
---|---|
[๋ฐฑ์ค,c++] 1356๋ฒ - ์ ์ง ์ (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 13549๋ฒ - ์จ๋ฐ๊ผญ์ง3 (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 13414๋ฒ - ์๊ฐ์ ์ฒญ (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 1330๋ฒ - ๋ ์ ๋น๊ตํ๊ธฐ (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 13241๋ฒ - ์ต์๊ณต๋ฐฐ์ (0) | 2021.11.04 |
๋๊ธ