记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:6:73: warning: format '%s' expects argument of type 'char*', but argument 11 has type 'int*' [-Wformat=]
  scanf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-%1s",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
                                                                         ^
/in/foo.cc:8:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
  if(jyw == 10 && char(j) == "X")
                             ^~~
/in/foo.cc:8:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
/in/foo.cc:10:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
  if(jyw == 10 && char(j) != "X")
                             ^~~
/in/foo.cc:10:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
/in/foo.cc:12:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
  if(jyw != 10 && char(j) == "X")
                             ^~~
/in/foo.cc:12:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
/in/foo.cc:14:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
  if(jyw != 10 && char(j) != "X"){
                             ^~~
/in/foo.cc:14:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]

信息

递交者
类型
递交
题目
P1158 ISBN号码
语言
C++
递交时间
2021-01-02 23:41:19
评测时间
2021-01-02 23:41:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes