#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 | #28042517 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.66 KB |
Data încărcării | 19 Februarie 2021, 18:00 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp:31:9: error: expected unqualified-id before 'int' Complex(int pr, int pi) ^ oop_numere_complexe.cpp:31:9: error: expected ')' before 'int' oop_numere_complexe.cpp:37:13: error: expected unqualified-id before ')' token Complex() ^ oop_numere_complexe.cpp: In function 'void set(int, int)': oop_numere_complexe.cpp:44:9: error: invalid use of 'this' in non-member function this->r = pr; ^ oop_numere_complexe.cpp:45:9: error: invalid use of 'this' in non-member function this->i = pi; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:50:21: error: invalid use of 'this' in non-member function double dr = this->r; ^ oop_numere_complexe.cpp:51:21: error: invalid use of 'this' in non-member function double di = this->i; ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:58:16: error: invalid use of 'this' in non-member function return this->r; ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:63:16: error: invalid use of 'this' in non-member function return this->i; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:66:5: error: 'friend' used outside of class friend ostream &operator<<(ostream &os, const Complex &a) ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:97:35: error: invalid use of 'this' in non-member function return Complex(a.real() + this->real(), a.imag() + this->imag()); ^ oop_numere_complexe.cpp:97:60: error: invalid use of 'this' in non-member function return Complex(a.real() + this->real(), a.imag() + this->imag()); ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:103:24: error: invalid use of 'this' in non-member function return Complex(this->real() - a.real(), this->imag() - a.imag()); ^ oop_numere_complexe.cpp:103:49: error: invalid use of 'this' in non-member function return Complex(this->real() - a.real(), this->imag() - a.imag()); ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:109:35: error: invalid use of 'this' in non-member function return Complex(a.real() * this->real() - a.imag() * this->imag(), ^ oop_numere_complexe.cpp:109:61: error: invalid use of 'this' in non-member function return Complex(a.real() * this->real() - a.imag() * this->imag(), ^ oop_numere_complexe.cpp:110:35: error: invalid use of 'this' in non-member function a.real() * this->imag() + a.imag() * this->real()); ^ oop_numere_complexe.cpp:110:61: error: invalid use of 'this' in non-member function a.real() * this->imag() + a.imag() * this->real()); ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:59:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:64:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:98:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:104:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:111:5: 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ă.