记录详情

Compile Error

foo.cc:3:31: error: 'int time' redeclared as different kind of entity
    3 | int n,k,t[21],a[21],b[21]={0},time=100000,temp;
      |                               ^~~~
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 'void search(int)':
foo.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if(temp<time)
      |           ^~~~
foo.cc:13:8: error: assignment of function 'time_t time(time_t*)'
   13 |    time=temp;
      |    ~~~~^~~~~
foo.cc: In function 'int main()':
foo.cc:33:8: warning: the address of 'time_t time(time_t*)' will never be NULL [-Waddress]
   33 |  cout<<time;
      |        ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
最佳调度问题
题目数据
下载
语言
C++
递交时间
2022-05-22 20:34:06
评测时间
2022-05-22 20:34:06
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes