P1190 接水問題
第一次提交,“不能定義time變量” ;修改變量名后,AC;為什么Dev-C里面沒報(bào)錯(cuò)呢?
神奇的CE了,完全看不懂洛谷編譯器顯示的東西
/tmp/tmpjcx93_mx/src:7:17: 錯(cuò)誤:‘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: 在函數(shù)‘int main()’中:
/tmp/tmpjcx93_mx/src:16:23: 警告:在算術(shù)表達(dá)式中使用了函數(shù)指針 [-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: 警告:在算術(shù)表達(dá)式中使用了函數(shù)指針 [-Wpointer-arith]
tap[tap_min] += time[i] ;
^
/tmp/tmpjcx93_mx/src:26:16: 警告:在算術(shù)表達(dá)式中使用了函數(shù)指針 [-Wpointer-arith]
tap[tap_min] += time[i] ; ~~~~~~~~~~~~^~~~~~~~~
/tmp/tmpjcx93_mx/src:26:16: 錯(cuò)誤:invalid conversion from ‘time_t ()(time_t) throw ()’ {aka ‘long int ()(long int)’} to ‘int’ [-fpermissive]