Submission #486404

#TimeUsernameProblemLanguageResultExecution timeMemory
486404rainboyDijamant (COI16_dijament)C11
0 / 100
46 ms3836 KiB
#include <stdio.h> #include <string.h> #define N 100 char ss[N + 1][16]; int n; int idx(char *s) { int i; for (i = 0; i < n; i++) if (strcmp(ss[i], s) == 0) return i; strcpy(ss[n], s); return n++; } int main() { int q; scanf("%d", &q); while (q--) { static char cc[16], pp[16]; int i; scanf("%s%*s", cc); while (1) { scanf("%s", pp); if (pp[0] == ';') break; } i = idx(cc); printf(i == n - 1 ? "ok\n" : "greska\n"); } return 0; }

Compilation message (stderr)

dijament.c: In function 'main':
dijament.c:21:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |  scanf("%d", &q);
      |  ^~~~~~~~~~~~~~~
dijament.c:26:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   26 |   scanf("%s%*s", cc);
      |   ^~~~~~~~~~~~~~~~~~
dijament.c:28:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |    scanf("%s", pp);
      |    ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...