Submission #16958

# Submission time Handle Problem Language Result Execution time Memory
16958 2015-11-03T03:23:52 Z taehoon1018 MathWorlds (YDX13_mathworlds) C++
0 / 1
0 ms 1084 KB
#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");
 
}
# Verdict Execution time Memory 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 -