Submission #222357

#TimeUsernameProblemLanguageResultExecution timeMemory
222357rainyACM (COCI19_acm)C++14
10 / 50
11 ms368 KiB
#include<bits/stdc++.h> using namespace std; int N,M; char tn[25]; char mt[25]="NijeZivotJedanACM"; int ans; int main(){ scanf("%d%d",&N,&M); for(int i=0;i<N+1;i++){ scanf("%s",&tn); if(strcmp(tn,mt)==0&&i!=N)ans=i+1; // else printf("|%s|\n|%s|",tn,mt); char t='a'; while(t!='\n')scanf("%c",&t); } printf("%d\n",ans); return 0; }

Compilation message (stderr)

acm.cpp: In function 'int main()':
acm.cpp:11:23: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[25]' [-Wformat=]
         scanf("%s",&tn);
                    ~~~^
acm.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&N,&M);
     ~~~~~^~~~~~~~~~~~~~
acm.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",&tn);
         ~~~~~^~~~~~~~~~
acm.cpp:15:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         while(t!='\n')scanf("%c",&t);
                       ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...