Borderou de evaluare (job #2745015)

Utilizator irimesdavid@yahoo.comIrimes David [email protected] Data 25 aprilie 2021 18:46:17
Problema Algoritmul lui Euclid Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'int div(int, int)': main.cpp:7:5: error: ambiguating new declaration of 'int div(int, int)' int div(int a, int b) ^~~ 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:5420, 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 main.cpp:1: /usr/include/stdlib.h:788:14: note: old declaration 'div_t div(int, int)' extern div_t div (int __numer, int __denom) ^~~ main.cpp:10:29: error: cannot convert 'div_t' to 'int' in return if(a>b) return div(a-b,b); ^ main.cpp:11:34: error: cannot convert 'div_t' to 'int' in return else if(a<b) return div(a,b-a); ^ main.cpp: In function 'int main()': main.cpp:20:9: error: no match for 'operator<<' (operand types are 'std::ofstream {aka std::basic_ofstream<char>}' and 'div_t') fout<<div(a,b)<<"\n"; ~~~~^~~~~~~~~~ In file included from /usr/include/c++/6/iostream:39:0, from main.cpp:1: /usr/include/c++/6/ostream:108:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(__ostream_type& (*__pf)(__ostream_type&)) ^~~~~~~~ /usr/include/c++/6/ostream:108:7: note: no known conversion for argument 1 from 'div_t' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}' /usr/include/c++/6/ostream:117:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>] operator<<(__ios_type& (*__pf)(__ios_type&)) ^~~~~~~~ /usr/include/c++/6/ostream:117:7: note: no known conversion for argument 1 from 'div_t' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}' /usr/include/c++/6/ostream:127:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(ios_base& (*__pf) (ios_base&)) ^~~~~~~~ /usr/include/c++/6/ostream:127:7: note: no known conversion for argument 1 from 'div_t' to 'std::ios_base& (*)(std::ios_base&)' /usr/include/c++/6/ostream:166:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(long __n) ^~~~~~~~ /usr/include/c++/6/ostream:166:7: note: no known conversion for argument 1 from 'div_t' to 'long int' /usr/include/c++/6/ostream:170:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] operator<<(unsigned long __n) ^~~~~~~~ /usr/include/c++/6/ostream:170:7: note: no known conversion for argument 1 from 'div_t' to 'long unsigned int' /usr/include/c++/6/ostream:174:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] Non zero exit status: 1

Ceva nu functioneaza?