记录详情

Compile Error

foo.cc:21:12: error: 'int time [10]' redeclared as different kind of entity
   21 | int time[10]={0,1,5,-1,-1,2,-1,-1,8,-1};
      |            ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/gthr.h:148,
                 from /usr/include/c++/9/ext/atomicity.h:35,
                 from /usr/include/c++/9/bits/ios_base.h:39,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/time.h:75:15: note: previous declaration 'time_t time(time_t*)'
   75 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
foo.cc: In function 'int main()':
foo.cc:33:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   33 |    int u=time[s[i]-'0'];
      |                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
foo.cc:33:23: error: invalid conversion from 'time_t (*)(time_t*) throw ()' {aka 'long int (*)(long int*)'} to 'int' [-fpermissive]
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1280 时间翻转
语言
C++
递交时间
2022-08-03 14:39:44
评测时间
2022-08-03 14:39:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes