#include <stdio.h>
int main(void)
{
int x, y, z, count = 0;
char ch;
scanf("%d%d%d", &x, &y, &z);
if (x + y == z)
{
count++;
ch = '+';
}
if (x - y == z)
{
ch = '-';
count++;
}
if (x*y == z)
{
ch = '*';
count++;
}
if (x / y == z && x % y ==0)
{
count++;
ch = '/';
}
if (count == 1)
printf("%c", ch);
else
printf("Invalid");
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1084 KB |
Output is correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Runtime error |
0 ms |
1080 KB |
SIGFPE Floating point exception |
4 |
Halted |
0 ms |
0 KB |
- |