#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 | #24011524 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.23 KB |
Data încărcării | 23 Septembrie 2020, 10:49 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp:31:12: error: expected unqualified-id before 'float' Complex(float pr, float pi) ^ oop_numere_complexe.cpp:31:12: error: expected ')' before 'float' oop_numere_complexe.cpp:36: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:22: error: invalid use of 'this' in non-member function return sqrt((this->r * this->r) + (this->i * this->i)); ^ oop_numere_complexe.cpp:48:32: error: invalid use of 'this' in non-member function return sqrt((this->r * this->r) + (this->i * this->i)); ^ oop_numere_complexe.cpp:48:44: error: invalid use of 'this' in non-member function return sqrt((this->r * this->r) + (this->i * this->i)); ^ oop_numere_complexe.cpp:48:54: error: invalid use of 'this' in non-member function return sqrt((this->r * this->r) + (this->i * this->i)); ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:52: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:56:16: error: invalid use of 'this' in non-member function return this->i; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:58:5: error: 'friend' used outside of class friend ostream& operator<<(ostream& out, const Complex& c) ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:77:24: error: invalid use of 'this' in non-member function return Complex(this->r + c.r, this->i + c.i); ^ oop_numere_complexe.cpp:77:39: error: invalid use of 'this' in non-member function return Complex(this->r + c.r, this->i + c.i); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:77:36: error: within this context return Complex(this->r + c.r, this->i + c.i); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:77:51: error: within this context return Complex(this->r + c.r, this->i + c.i); ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:81:24: error: invalid use of 'this' in non-member function return Complex(this->r - c.r, this->i - c.i); ^ oop_numere_complexe.cpp:81:39: error: invalid use of 'this' in non-member function return Complex(this->r - c.r, this->i - c.i); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:81:36: error: within this context return Complex(this->r - c.r, this->i - c.i); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:81:51: error: within this context return Complex(this->r - c.r, this->i - c.i); ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:85:24: error: invalid use of 'this' in non-member function return Complex(this->r * c.r - this->i * c.i, this->r * c.i + this->i * c.r); ^ oop_numere_complexe.cpp:85:40: error: invalid use of 'this' in non-member function return Complex(this->r * c.r - this->i * c.i, this->r * c.i + this->i * c.r); ^ oop_numere_complexe.cpp:85:55: error: invalid use of 'this' in non-member function return Complex(this->r * c.r - this->i * c.i, this->r * c.i + this->i * c.r); ^ oop_numere_complexe.cpp:85:71: error: invalid use of 'this' in non-member function return Complex(this->r * c.r - this->i * c.i, this->r * c.i + this->i * c.r); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:85:36: error: within this context return Complex(this->r * c.r - this->i * c.i, this->r * c.i + this->i * c.r); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:85:52: error: within this context return Complex(this->r * c.r - this->i * c.i, this->r * c.i + this->i * c.r); ^ oop_numere_complexe.cpp: In function 'double modul()': oop_numere_complexe.cpp:49:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:53:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'int imag()': oop_numere_complexe.cpp:57:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:78:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:82:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:86: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ă.