Submission #949045

#TimeUsernameProblemLanguageResultExecution timeMemory
949045rainboyMathWorlds (YDX13_mathworlds)C11
1 / 1
1 ms600 KiB
#include <stdio.h> int main() { int x, y, z, b; scanf("%d%d%d", &x, &y, &z); b = 0; if (x + y == z) b |= 1; if (x - y == z) b |= 2; if ((long long) x * y == z) b |= 4; if (y != 0 && x % y == 0 && x / y == z) b |= 8; if (b == 1) printf("+\n"); else if (b == 2) printf("-\n"); else if (b == 4) printf("*\n"); else if (b == 8) printf("/\n"); else printf("Invalid\n"); return 0; }

Compilation message (stderr)

D.c: In function 'main':
D.c:6:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d%d%d", &x, &y, &z);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...