Submission #1110656

#TimeUsernameProblemLanguageResultExecution timeMemory
1110656vjudge1Tuna (COCI17_tuna)C++98
Compilation error
0 ms0 KiB
#include <stdio.h> int main() { int y, x, a, z, b, toplam = 0; scanf("%d", &y); scanf("%d", &x); for (int i = 0; i < y; i++) { scanf("%d %d", &a, &z); int fark = a - z; if (fark < 0) fark = -fark; if (fark <= x) { toplam += (a > z) ? a : z; } scanf("%d", &b); toplam += b; }

Compilation message (stderr)

tuna.cpp: In function 'int main()':
tuna.cpp:16:9: error: expected '}' at end of input
   16 |         }
      |         ^
tuna.cpp:3:12: note: to match this '{'
    3 | int main() {
      |            ^
tuna.cpp:5:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |     scanf("%d", &y);
      |     ~~~~~^~~~~~~~~~
tuna.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d", &x);
      |     ~~~~~^~~~~~~~~~
tuna.cpp:8:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |         scanf("%d %d", &a, &z);
      |         ~~~~~^~~~~~~~~~~~~~~~~
tuna.cpp:14:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |             scanf("%d", &b);
      |             ~~~~~^~~~~~~~~~