#3539
oop_numere_complexe
C++
Ai primit definiția unei clase. Implementează toate metodele clasei.
Problema | oop_numere_complexe | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #23083834 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.71 KB |
Data încărcării | 22 Mai 2020, 10:15 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp:35:7: error: redefinition of 'class Complex' class Complex ^ oop_numere_complexe.cpp:4:7: error: previous definition of 'class Complex' class Complex ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex, Complex)': oop_numere_complexe.cpp:106:13: error: ambiguous overload for 'operator+' (operand types are 'Complex' and 'Complex') return c+d; ^ oop_numere_complexe.cpp:106:13: note: candidates are: oop_numere_complexe.cpp:24:13: note: Complex Complex::operator+(Complex) Complex operator +(Complex ); ^ oop_numere_complexe.cpp:86:9: note: Complex operator+(Complex, Complex) Complex operator+(Complex a, Complex b) ^ oop_numere_complexe.cpp: In function 'int main()': oop_numere_complexe.cpp:116:31: error: ambiguous overload for 'operator*' (operand types are 'Complex' and 'Complex') cout << a.modul()<<" "<< a*b << " " << a+b << " " << a-b; ^ oop_numere_complexe.cpp:116:31: note: candidates are: oop_numere_complexe.cpp:28:13: note: Complex Complex::operator*(Complex) Complex operator *(Complex ); ^ oop_numere_complexe.cpp:98:9: note: Complex operator*(Complex, Complex) Complex operator*(Complex a, Complex b) ^ oop_numere_complexe.cpp:116:45: error: ambiguous overload for 'operator+' (operand types are 'Complex' and 'Complex') cout << a.modul()<<" "<< a*b << " " << a+b << " " << a-b; ^ oop_numere_complexe.cpp:116:45: note: candidates are: oop_numere_complexe.cpp:24:13: note: Complex Complex::operator+(Complex) Complex operator +(Complex ); ^ oop_numere_complexe.cpp:86:9: note: Complex operator+(Complex, Complex) Complex operator+(Complex a, Complex b) ^ oop_numere_complexe.cpp:116:59: error: ambiguous overload for 'operator-' (operand types are 'Complex' and 'Complex') cout << a.modul()<<" "<< a*b << " " << a+b << " " << a-b; ^ oop_numere_complexe.cpp:116:59: note: candidates are: oop_numere_complexe.cpp:26:13: note: Complex Complex::operator-(Complex) Complex operator -(Complex ); ^ oop_numere_complexe.cpp:92:9: note: Complex operator-(Complex, Complex) Complex operator-(Complex a, Complex b) ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex, Complex)': oop_numere_complexe.cpp:107:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema oop_numere_complexe face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.