QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#97097#3614. Math TradeZhaoZiLongCompile Error//C++231.4kb2023-04-16 15:24:182023-04-16 15:24:20

详细

answer.code: In function ‘int main()’:
answer.code:44:25: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[100]’ [-Wformat=]
   44 |                 scanf("%s %s %s", &name[i].a, &name[i].b, &name[i].c);
      |                        ~^         ~~~~~~~~~~
      |                         |         |
      |                         char*     char (*)[100]
answer.code:44:28: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘char (*)[100]’ [-Wformat=]
   44 |                 scanf("%s %s %s", &name[i].a, &name[i].b, &name[i].c);
      |                           ~^                  ~~~~~~~~~~
      |                            |                  |
      |                            char*              char (*)[100]
answer.code:44:31: warning: format ‘%s’ expects argument of type ‘char*’, but argument 4 has type ‘char (*)[100]’ [-Wformat=]
   44 |                 scanf("%s %s %s", &name[i].a, &name[i].b, &name[i].c);
      |                              ~^                           ~~~~~~~~~~
      |                               |                           |
      |                               char*                       char (*)[100]
answer.code:48:29: error: ‘strcmp’ was not declared in this scope
   48 |                         if (strcmp(name[i].b ,name[j].b)==0)
      |                             ^~~~~~
answer.code:3:1: note: ‘strcmp’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
    2 | #include<map>
  +++ |+#include <cstring>
    3 | #include<stdio.h>
answer.code:61:29: error: ‘strcmp’ was not declared in this scope
   61 |                         if (strcmp(name[i].c ,name[j].b)==0)
      |                             ^~~~~~
answer.code:61:29: note: ‘strcmp’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
answer.code: In function ‘int dfs(int, int)’:
answer.code:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
answer.code: In function ‘int main()’:
answer.code:38:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   38 |         scanf("%d",&n);
      |         ~~~~~^~~~~~~~~
answer.code:44:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   44 |                 scanf("%s %s %s", &name[i].a, &name[i].b, &name[i].c);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~