#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 | #51632912 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.15 KB |
Data încărcării | 24 Iulie 2024, 20:03 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp:32:13: error: expected unqualified-id before 'int' Complex(int pr, int pi) ^ oop_numere_complexe.cpp:32: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:46:9: error: 'r' was not declared in this scope r = pr; ^ oop_numere_complexe.cpp:47:9: error: 'i' was not declared in this scope i = pi; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:51:21: error: 'i' was not declared in this scope return sqrt(i*i + r*r); ^ oop_numere_complexe.cpp:51:27: 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:54:23: error: 'r' was not declared in this scope int real(){return r;} ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:56:23: error: 'i' was not declared in this scope int imag(){return i;} ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:58:5: error: 'friend' used outside of class friend ostream& operator<<(ostream& COUT, const Complex& NR) ^ 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:78:13: error: within this context aux.r = NR.r + r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:78:20: error: within this context aux.r = NR.r + r; ^ oop_numere_complexe.cpp:78:24: error: 'r' was not declared in this scope aux.r = NR.r + r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:79:13: error: within this context aux.i = NR.i + i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:79:20: error: within this context aux.i = NR.i + i; ^ oop_numere_complexe.cpp:79:24: error: 'i' was not declared in this scope aux.i = NR.i + 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:86:13: error: within this context aux.r = NR.r - r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:86:20: error: within this context aux.r = NR.r - r; ^ oop_numere_complexe.cpp:86:24: error: 'r' was not declared in this scope aux.r = NR.r - r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:87:13: error: within this context aux.i = NR.i - i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:87:20: error: within this context aux.i = NR.i - i; ^ oop_numere_complexe.cpp:87:24: error: 'i' was not declared in this scope aux.i = NR.i - 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:94:13: error: within this context aux.r = NR.r * r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:94:20: error: within this context aux.r = NR.r * r; ^ oop_numere_complexe.cpp:94:24: error: 'r' was not declared in this scope aux.r = NR.r * r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:95:13: error: within this context aux.i = NR.i * i * -1; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:95:20: error: within this context aux.i = NR.i * i * -1; ^ oop_numere_complexe.cpp:95:24: error: 'i' was not declared in this scope aux.i = NR.i * i * -1; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:52:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:54:25: warning: control reaches end of non-void function [-Wreturn-type] int real(){return r;} ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:56:25: warning: control reaches end of non-void function [-Wreturn-type] int imag(){return i;} ^
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ă.