#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 | #50964466 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 1.28 KB |
Data încărcării | 16 Mai 2024, 10:34 | Scor / rezultat | Eroare de compilare |
oop_numere_complexe.cpp: In constructor 'Complex::Complex(int, int)': oop_numere_complexe.cpp:7:12: warning: 'Complex::r' will be initialized after [-Wreorder] int i, r; ^ oop_numere_complexe.cpp:7:9: warning: 'int Complex::i' [-Wreorder] int i, r; ^ oop_numere_complexe.cpp:31:1: warning: when initialized here [-Wreorder] Complex::Complex(int pr, int pi): r{pr}, i{pi}{} ^ oop_numere_complexe.cpp: In function 'std::ostream& operator<<(std::ostream&, const Complex&)': oop_numere_complexe.cpp:63:13: error: 'out' was not declared in this scope out << a; ^ oop_numere_complexe.cpp:66:17: error: 'out' was not declared in this scope out << b; ^ oop_numere_complexe.cpp:68:17: error: 'out' was not declared in this scope out<< "0"; ^ oop_numere_complexe.cpp:69:12: error: 'out' was not declared in this scope return out; ^ oop_numere_complexe.cpp: In function 'Complex operator+(Complex)': oop_numere_complexe.cpp:74:18: error: invalid use of 'this' in non-member function int re = this->r + c.real(); ^ oop_numere_complexe.cpp:75:18: error: invalid use of 'this' in non-member function int im = this->i + c.imag(); ^ oop_numere_complexe.cpp: In function 'Complex operator-(Complex)': oop_numere_complexe.cpp:82:18: error: invalid use of 'this' in non-member function int re = this->r - c.real(); ^ oop_numere_complexe.cpp:83:18: error: invalid use of 'this' in non-member function int im = this->i - c.imag(); ^ oop_numere_complexe.cpp: In function 'Complex operator*(Complex)': oop_numere_complexe.cpp:90:14: error: invalid use of 'this' in non-member function int re = this->r * c.real() - this->i * c.imag(); ^ oop_numere_complexe.cpp:90:35: error: invalid use of 'this' in non-member function int re = this->r * c.real() - this->i * c.imag(); ^ oop_numere_complexe.cpp:91:14: error: invalid use of 'this' in non-member function int im = this->r * c.imag() + this->i * c.real(); ^ oop_numere_complexe.cpp:91:35: error: invalid use of 'this' in non-member function int im = this->r * c.imag() + this->i * c.real(); ^ oop_numere_complexe.cpp: In function 'std::ostream& operator<<(std::ostream&, const Complex&)': oop_numere_complexe.cpp:70:1: 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ă.