#3539
Ai primit definiția unei clase. Implementează toate metodele clasei.
Problema | oop_numere_complexe | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58223770 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.58 KB |
Data încărcării | 21 Mai 2025, 08:44 | 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:36:13: error: expected unqualified-id before ')' token Complex() ^ oop_numere_complexe.cpp: In function 'void set(int, int)': oop_numere_complexe.cpp:43:9: error: 'i' was not declared in this scope i = pi; r = pr; ^ oop_numere_complexe.cpp:43:17: error: 'r' was not declared in this scope i = pi; r = pr; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:48:21: error: 'i' was not declared in this scope return sqrt(i * i + r * r); ^ oop_numere_complexe.cpp:48:29: error: 'r' was not declared in this scope return sqrt(i * i + r * r); ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:53:16: error: 'r' was not declared in this scope return r; ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:58:16: error: 'i' was not declared in this scope return i; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:61:5: error: 'friend' used outside of class friend ostream& operator<<(ostream &out , const Complex &a) ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:83:11: error: within this context b.i += this->i; ^ oop_numere_complexe.cpp:83:16: error: invalid use of 'this' in non-member function b.i += this->i; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:84:11: error: within this context b.r += this->r; ^ oop_numere_complexe.cpp:84:16: error: invalid use of 'this' in non-member function b.r += this->r; ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:91:11: error: within this context c.i = this->i - b.i; ^ oop_numere_complexe.cpp:91:15: error: invalid use of 'this' in non-member function c.i = this->i - b.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:91:27: error: within this context c.i = this->i - b.i; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:92:11: error: within this context c.r = this->r - b.r; ^ oop_numere_complexe.cpp:92:15: error: invalid use of 'this' in non-member function c.r = this->r - b.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:92:27: error: within this context c.r = this->r - b.r; ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:99:11: error: within this context c.i = (this->r * b.i + this->i * b.r); ^ oop_numere_complexe.cpp:99:16: error: invalid use of 'this' in non-member function c.i = (this->r * b.i + this->i * b.r); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:99:28: error: within this context c.i = (this->r * b.i + this->i * b.r); ^ oop_numere_complexe.cpp:99:32: error: invalid use of 'this' in non-member function c.i = (this->r * b.i + this->i * b.r); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:99:44: error: within this context c.i = (this->r * b.i + this->i * b.r); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:100:11: error: within this context c.r = this->r * b.r - this->i * b.i; ^ oop_numere_complexe.cpp:100:15: error: invalid use of 'this' in non-member function c.r = this->r * b.r - this->i * b.i; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:100:27: error: within this context c.r = this->r * b.r - this->i * b.i; ^ oop_numere_complexe.cpp:100:31: error: invalid use of 'this' in non-member function c.r = this->r * b.r - this->i * b.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:100:43: error: within this context c.r = this->r * b.r - this->i * b.i; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:49:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:54:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:59: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ă.