P1190 接水问题
第一次提交,“不能定义time变量” ;修改变量名后,AC;为什么Dev-C里面没报错呢?
神奇的CE了,完全看不懂洛谷编译器显示的东西
/tmp/tmpjcx93_mx/src:7:17: 错误:‘int time [10010]’被重新声明为不同意义的符号
int time[NR + 10] ;
^
In file included from /usr/include/pthread.h:24,
from /usr/include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/8/bits/gthr.h:148,
from /usr/include/c++/8/ext/atomicity.h:35,
from /usr/include/c++/8/bits/ios_base.h:39,
from /usr/include/c++/8/ios:42,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from /tmp/tmpjcx93_mx/src:1:
/usr/include/time.h:75:15: 附注:previous declaration ‘time_t time(time_t)’
extern time_t time (time_t __timer) __THROW;
^~~~
/tmp/tmpjcx93_mx/src: 在函数‘int main()’中:
/tmp/tmpjcx93_mx/src:16:23: 警告:在算术表达式中使用了函数指针 [-Wpointer-arith]
scanf("%d" , &time[i]) ;
^
/tmp/tmpjcx93_mx/src:16:9: 警告:格式 ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘time_t ()(time_t) throw ()’ {aka ‘long int ()(long int*)’} [-Wformat=]
scanf("%d" , &time[i]) ;
^~~~ ~~~~~~~~
/tmp/tmpjcx93_mx/src:26:25: 警告:在算术表达式中使用了函数指针 [-Wpointer-arith]
tap[tap_min] += time[i] ;
^
/tmp/tmpjcx93_mx/src:26:16: 警告:在算术表达式中使用了函数指针 [-Wpointer-arith]
tap[tap_min] += time[i] ; ~~~~~~~~~~~~^~~~~~~~~
/tmp/tmpjcx93_mx/src:26:16: 错误:invalid conversion from ‘time_t ()(time_t) throw ()’ {aka ‘long int ()(long int)’} to ‘int’ [-fpermissive]












网友评论