#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 | #44220001 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.69 KB |
Data încărcării | 14 Iulie 2023, 14:23 | 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:39:13: error: expected unqualified-id before ')' token Complex() ^ oop_numere_complexe.cpp: In function 'void set(int, int)': oop_numere_complexe.cpp:47:9: error: 'i' was not declared in this scope i = pi; ^ oop_numere_complexe.cpp:48:9: error: 'r' was not declared in this scope r = pr; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:53:21: error: 'i' was not declared in this scope return sqrt(i * i + r * r); ^ oop_numere_complexe.cpp:53: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:58:16: error: 'r' was not declared in this scope return r; ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:63:16: error: 'i' was not declared in this scope return i; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:66:5: error: 'friend' used outside of class friend ostream &operator<<(ostream &out, const Complex &z) ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:90:11: error: within this context z.r += this->r; ^ oop_numere_complexe.cpp:90:16: error: invalid use of 'this' in non-member function z.r += this->r; ^ 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 z.i += this->i; ^ oop_numere_complexe.cpp:91:16: error: invalid use of 'this' in non-member function z.i += this->i; ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:97:11: error: within this context z.r = this->r - z.r; ^ oop_numere_complexe.cpp:97:15: error: invalid use of 'this' in non-member function z.r = this->r - z.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:97:27: error: within this context z.r = this->r - z.r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:98:11: error: within this context z.i = this->i - z.i; ^ oop_numere_complexe.cpp:98:15: error: invalid use of 'this' in non-member function z.i = this->i - z.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:98:27: error: within this context z.i = this->i - z.i; ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:104:20: error: within this context int zr = z.r, zi = z.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:104:30: error: within this context int zr = z.r, zi = z.i; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:105:16: error: within this context zr = z.r * this->r - z.i * this->i; ^ oop_numere_complexe.cpp:105:20: error: invalid use of 'this' in non-member function zr = z.r * this->r - z.i * this->i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:105:32: error: within this context zr = z.r * this->r - z.i * this->i; ^ oop_numere_complexe.cpp:105:36: error: invalid use of 'this' in non-member function zr = z.r * this->r - z.i * this->i; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:106:16: error: within this context zi = z.r * this->i + z.i * this->r; ^ oop_numere_complexe.cpp:106:20: error: invalid use of 'this' in non-member function zi = z.r * this->i + z.i * this->r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:106:32: error: within this context zi = z.r * this->i + z.i * this->r; ^ oop_numere_complexe.cpp:106:36: error: invalid use of 'this' in non-member function zi = z.r * this->i + z.i * this->r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:107:11: error: within this context z.r = zr; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:108:11: error: within this context z.i = zi; ^ oop_numere_complexe.cpp:113:1: error: a function-definition is not allowed here before '{' token { ^ oop_numere_complexe.cpp:120:1: error: expected '}' at end of input } ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:54:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ 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] } ^
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ă.