#3539
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 | #64160181 | Utilizator | |
| Fișier | oop_numere_complexe.cpp | Dimensiune | 830 B |
| Data încărcării | 21 Aprilie 2026, 08:35 | Scor/rezultat | Eroare de compilare |
oop_numere_complexe.cpp: In function ‘Complex operator+(const Complex&)’: oop_numere_complexe.cpp:66:20: error: ‘r’ was not declared in this scope 66 | return Complex(r + other.r, i + other.i); | ^ oop_numere_complexe.cpp:66:33: error: ‘i’ was not declared in this scope 66 | return Complex(r + other.r, i + other.i); | ^ oop_numere_complexe.cpp:66:30: error: ‘int Complex::r’ is private within this context 66 | return Complex(r + other.r, i + other.i); | ^ oop_numere_complexe.cpp:7:12: note: declared private here 7 | int i, r; | ^ oop_numere_complexe.cpp:66:43: error: ‘int Complex::i’ is private within this context 66 | return Complex(r + other.r, i + other.i); | ^ oop_numere_complexe.cpp:7:9: note: declared private here 7 | int i, r; | ^ oop_numere_complexe.cpp: In function ‘Complex operator-(const Complex&)’: oop_numere_complexe.cpp:71:20: error: ‘r’ was not declared in this scope 71 | return Complex(r - other.r, i - other.i); | ^ oop_numere_complexe.cpp:71:33: error: ‘i’ was not declared in this scope 71 | return Complex(r - other.r, i - other.i); | ^ oop_numere_complexe.cpp:71:30: error: ‘int Complex::r’ is private within this context 71 | return Complex(r - other.r, i - other.i); | ^ oop_numere_complexe.cpp:7:12: note: declared private here 7 | int i, r; | ^ oop_numere_complexe.cpp:71:43: error: ‘int Complex::i’ is private within this context 71 | return Complex(r - other.r, i - other.i); | ^ oop_numere_complexe.cpp:7:9: note: declared private here 7 | int i, r; | ^ oop_numere_complexe.cpp: In function ‘Complex operator*(const Complex&)’: oop_numere_complexe.cpp:76:20: error: ‘r’ was not declared in this scope 76 | return Complex(r * other.r - i * other.i, r * other.i + other.r * i); | ^ oop_numere_complexe.cpp:76:34: error: ‘i’ was not declared in this scope 76 | return Complex(r * other.r - i * other.i, r * other.i + other.r * i); | ^ oop_numere_complexe.cpp:76:30: error: ‘int Complex::r’ is private within this context 76 | return Complex(r * other.r - i * other.i, r * other.i + other.r * i); | ^ oop_numere_complexe.cpp:7:12: note: declared private here 7 | int i, r; | ^ oop_numere_complexe.cpp:76:44: error: ‘int Complex::i’ is private within this context 76 | return Complex(r * other.r - i * other.i, r * other.i + other.r * i); | ^ oop_numere_complexe.cpp:7:9: note: declared private here 7 | int i, r; | ^
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ă.