/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int toInt(char)':
foo.cc:56:17: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
 for(i=strlen(str)-1;i>=0;i--){
                 ^
In file included from foo.cc:2:0:
/usr/include/string.h:384:15: note:   initializing argument 1 of 'size_t strlen(const char*)'
 extern size_t strlen (const char *__s)
               ^~~~~~
foo.cc:57:16: error: invalid types 'char[int]' for array subscript
 ans+=base(str[i]-'0');
                ^
foo.cc:57:21: error: 'base' cannot be used as a function
 ans+=base(str[i]-'0');
                     ^
foo.cc: In function 'int main()':
foo.cc:15:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d %d",&max,&lines);
 ~~~~~^~~~~~~~~~~~~~~~~~~~~
foo.cc:17:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%s",problem);
 ~~~~~^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1300 儿子游戏机
语言
C++
递交时间
2021-08-28 14:03:18
评测时间
2021-08-28 14:03:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes