/ Vijos /

记录详情

Compile Error

/in/foo.cc:5:16: error: 'int random [1001]' redeclared as different kind of symbol
 int random[1001]={0};
                ^
In file included from /usr/include/c++/6/cstdlib:75:0,
                 from /usr/include/c++/6/ext/string_conversions.h:41,
                 from /usr/include/c++/6/bits/basic_string.h:5417,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:2:
/usr/include/stdlib.h:282:17: note: previous declaration 'long int random()'
 extern long int random (void) __THROW;
                 ^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:11:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   if(random[temp]==0)
                 ^
/in/foo.cc:12:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    res++,random[temp]=temp;
                     ^
/in/foo.cc:12:23: error: assignment of read-only location '*(random + ((sizetype)temp))'
    res++,random[temp]=temp;
                       ^~~~
/in/foo.cc:12:23: error: cannot convert 'int' to 'long int() throw ()' in assignment
/in/foo.cc:16:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   if(random[i]!=0)
              ^
/in/foo.cc:17:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    cout<<random[i]<<" ";
                  ^

信息

递交者
类型
递交
题目
P1316 明明的随机数
语言
C++
递交时间
2019-11-06 06:44:02
评测时间
2019-11-06 06:44:02
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes