#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 | #49578656 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.66 KB |
Data încărcării | 07 Martie 2024, 17:36 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp:33:13: error: expected unqualified-id before 'int' Complex(int pr, int pi){ ^ oop_numere_complexe.cpp:33:13: error: expected ')' before 'int' oop_numere_complexe.cpp:38: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: invalid use of 'this' in non-member function this -> r = pr; ^ oop_numere_complexe.cpp:44: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:48:26: error: 'i' was not declared in this scope return sqrt(pow(i,2) + pow(r,2)); ^ oop_numere_complexe.cpp:48:37: error: 'r' was not declared in this scope return sqrt(pow(i,2) + pow(r,2)); ^ 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:57:16: error: 'i' was not declared in this scope return i; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:60:5: error: 'friend' used outside of class friend ostream& operator<<(ostream& stream, const Complex& nr){ ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:79:21: error: invalid use of 'this' in non-member function Complex rez(this -> r + z.r, this -> i + z.i); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:79:35: error: within this context Complex rez(this -> r + z.r, this -> i + z.i); ^ oop_numere_complexe.cpp:79:38: error: invalid use of 'this' in non-member function Complex rez(this -> r + z.r, this -> i + z.i); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:79:52: error: within this context Complex rez(this -> r + z.r, this -> i + z.i); ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:84:21: error: invalid use of 'this' in non-member function Complex rez(this -> r - z.r, this -> i - z.i); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:84:35: error: within this context Complex rez(this -> r - z.r, this -> i - z.i); ^ oop_numere_complexe.cpp:84:38: error: invalid use of 'this' in non-member function Complex rez(this -> r - z.r, this -> i - z.i); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:84:52: error: within this context Complex rez(this -> r - z.r, this -> i - z.i); ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:50: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:58: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ă.