Borderou de evaluare (job #1653665)

Utilizator Dragos2811Rebegea Dragos Dragos2811 Data 16 martie 2016 13:23:48
Problema Livada Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp:6:38: error: ‘int rand’ redeclared as different kind of symbol int n,m,p,x,i,j,v[101],q,nr,nr1,maxi,rand,y; ^ In file included from /usr/include/c++/4.8/cstdlib:72:0, from /usr/include/c++/4.8/ext/string_conversions.h:41, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/stdlib.h:380:12: error: previous declaration of ‘int rand()’ extern int rand (void) __THROW; ^ user.cpp: In function ‘int main()’: user.cpp:18:54: warning: the address of ‘int rand()’ will never be NULL [-Waddress] if(rand==0){ rand=nr; ^ user.cpp:18:62: error: assignment of function ‘int rand()’ if(rand==0){ rand=nr; ^ user.cpp:18:62: error: cannot convert ‘int’ to ‘int()throw ()’ in assignment user.cpp:21:68: error: no matching function for call to ‘max(int (&)()throw (), int&)’ else { rand=max(rand,nr); ^ user.cpp:21:68: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: user.cpp:21:68: note: deduced conflicting types for parameter ‘const _Tp’ (‘int()throw ()’ and ‘int’) else { rand=max(rand,nr); ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: user.cpp:21:68: note: deduced conflicting types for parameter ‘const _Tp’ (‘int()throw ()’ and ‘int’)

Ceva nu functioneaza?