#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 | #23973423 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 825 B |
Data încărcării | 21 Septembrie 2020, 10:37 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp:32:1: error: expected unqualified-id before 'public' public: ^ oop_numere_complexe.cpp:37:13: error: expected unqualified-id before ')' token Complex(){ ^ oop_numere_complexe.cpp:46:6: error: expected unqualified-id before 'return' return sqrt(r^2+i^2); ^ oop_numere_complexe.cpp: In function 'int real()': oop_numere_complexe.cpp:48:9: error: named return values are no longer supported return r; ^ oop_numere_complexe.cpp:53:6: error: 't' was not declared in this scope t<<a.r<<'+'<<a.i<<'i'<<'\n'; ^ oop_numere_complexe.cpp:53:9: error: 'a' was not declared in this scope t<<a.r<<'+'<<a.i<<'i'<<'\n'; ^ oop_numere_complexe.cpp:54:5: warning: no return statement in function returning non-void [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex&)': oop_numere_complexe.cpp:56:6: error: invalid use of 'this' in non-member function this->i=this->i+a.i; ^ oop_numere_complexe.cpp:56:14: error: invalid use of 'this' in non-member function this->i=this->i+a.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:56:24: error: within this context this->i=this->i+a.i; ^ oop_numere_complexe.cpp:57:9: error: invalid use of 'this' in non-member function this->r=this->r+a.r; ^ oop_numere_complexe.cpp:57:17: error: invalid use of 'this' in non-member function this->r=this->r+a.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:57:27: error: within this context this->r=this->r+a.r; ^ oop_numere_complexe.cpp:58:5: warning: no return statement in function returning non-void [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex&)': oop_numere_complexe.cpp:60:6: error: invalid use of 'this' in non-member function this->i=this->i-a.i; ^ oop_numere_complexe.cpp:60:14: error: invalid use of 'this' in non-member function this->i=this->i-a.i; ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:60:24: error: within this context this->i=this->i-a.i; ^ oop_numere_complexe.cpp:61:9: error: invalid use of 'this' in non-member function this->r=this->r-a.r; ^ oop_numere_complexe.cpp:61:17: error: invalid use of 'this' in non-member function this->r=this->r-a.r; ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:61:27: error: within this context this->r=this->r-a.r; ^ oop_numere_complexe.cpp:62:5: warning: no return statement in function returning non-void [-Wreturn-type] } ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex&)': oop_numere_complexe.cpp:64:6: error: invalid use of 'this' in non-member function this->r=(this->r*a.r-this->i*a.i); ^ oop_numere_complexe.cpp:64:15: error: invalid use of 'this' in non-member function this->r=(this->r*a.r-this->i*a.i); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:64:25: error: within this context this->r=(this->r*a.r-this->i*a.i); ^ oop_numere_complexe.cpp:64:27: error: invalid use of 'this' in non-member function this->r=(this->r*a.r-this->i*a.i); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:64:37: error: within this context this->r=(this->r*a.r-this->i*a.i); ^ oop_numere_complexe.cpp:65:9: error: invalid use of 'this' in non-member function this->i=(this->r*a.i+this->i*a.r); ^ oop_numere_complexe.cpp:65:18: error: invalid use of 'this' in non-member function this->i=(this->r*a.i+this->i*a.r); ^ oop_numere_complexe.cpp:7:9: error: 'int Complex::i' is private int i, r; ^ oop_numere_complexe.cpp:65:28: error: within this context this->i=(this->r*a.i+this->i*a.r); ^ oop_numere_complexe.cpp:65:30: error: invalid use of 'this' in non-member function this->i=(this->r*a.i+this->i*a.r); ^ oop_numere_complexe.cpp:7:12: error: 'int Complex::r' is private int i, r; ^ oop_numere_complexe.cpp:65:40: error: within this context this->i=(this->r*a.i+this->i*a.r); ^ oop_numere_complexe.cpp:66:5: warning: no return statement in function returning non-void [-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ă.