/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int judge(std::__cxx11::string, std::__cxx11::string, std::__cxx11::string)':
/in/foo.cc:20:18: error: cannot convert 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'char*' for argument '1' to 'char* strcpy(char*, const char*)'
      strcpy(ss,s1);
                  ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:28:14: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=]
  scanf("%d",n);
              ^
/in/foo.cc:29:27: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' [-Wformat=]
  scanf("%s %s %s",s1,s2,s3);
                           ^
/in/foo.cc:29:27: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' [-Wformat=]
/in/foo.cc:29:27: warning: format '%s' expects argument of type 'char*', but argument 4 has type 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' [-Wformat=]
/in/foo.cc:30:37: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' [-Wformat=]
  if(judge(s1,s2,s3))  printf("%s",ss);
                                     ^
/in/foo.cc:31:41: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' [-Wformat=]
  else if(judge(s2,s1,s3)) printf("%s",ss);
                                         ^
/in/foo.cc:32:41: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' [-Wformat=]
  else if(judge(s3,s1,s2)) printf("%s",ss);
                                         ^

信息

递交者
类型
递交
题目
P1449 字符串还原
语言
C++
递交时间
2019-04-01 19:34:41
评测时间
2019-04-01 19:34:41
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes