#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 | #29302777 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.41 KB |
Data încărcării | 15 Aprilie 2021, 22:41 | 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->i=pi; ^ oop_numere_complexe.cpp:44:9: error: invalid use of 'this' in non-member function this->r=pr; ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:48:15: error: invalid use of 'this' in non-member function int a=this->i; ^ oop_numere_complexe.cpp:49:15: error: invalid use of 'this' in non-member function int b=this->r; ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:54:16: error: invalid use of 'this' in non-member function return this->r; ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:58:16: error: invalid use of 'this' in non-member function return this->i; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:61:5: error: 'friend' used outside of class friend ostream& operator<<(ostream& os, const Complex& c){ ^ 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:70:13: error: within this context rez.r=r+a.r; ^ oop_numere_complexe.cpp:70:15: error: 'r' was not declared in this scope rez.r=r+a.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:70:19: error: within this context rez.r=r+a.r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:71:13: error: within this context rez.i=i+a.i; ^ oop_numere_complexe.cpp:71:15: error: 'i' was not declared in this scope rez.i=i+a.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:71:19: error: within this context rez.i=i+a.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:77:13: error: within this context rez.r=r-a.r; ^ oop_numere_complexe.cpp:77:15: error: 'r' was not declared in this scope rez.r=r-a.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:77:19: error: within this context rez.r=r-a.r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:78:13: error: within this context rez.i=i-a.i; ^ oop_numere_complexe.cpp:78:15: error: 'i' was not declared in this scope rez.i=i-a.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:78:19: error: within this context rez.i=i-a.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:85:13: error: within this context rez.r=r*a.r-i*a.i; ^ oop_numere_complexe.cpp:85:15: error: 'r' was not declared in this scope rez.r=r*a.r-i*a.i; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:85:19: error: within this context rez.r=r*a.r-i*a.i; ^ oop_numere_complexe.cpp:85:21: error: 'i' was not declared in this scope rez.r=r*a.r-i*a.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:85:25: error: within this context rez.r=r*a.r-i*a.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:86:13: error: within this context rez.i=r*a.i+i*a.r; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:86:19: error: within this context rez.i=r*a.i+i*a.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:86:25: error: within this context rez.i=r*a.i+i*a.r; ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:55: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ă.