#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 | #59834697 | Utilizator | |
| Fișier | oop_numere_complexe.cpp | Dimensiune | 3.84 KB |
| Data încărcării | 10 Octombrie 2025, 10:46 | Scor/rezultat | Eroare de compilare |
oop_numere_complexe.cpp:31:7: error: expected nested-name-specifier before 'System' using System; ^ oop_numere_complexe.cpp:31:7: error: 'System' has not been declared oop_numere_complexe.cpp:32:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ oop_numere_complexe.cpp:32:7: error: 'System' has not been declared oop_numere_complexe.cpp:32:13: error: expected ';' before '.' token using System.Collections.Generic; ^ oop_numere_complexe.cpp:32:13: error: expected unqualified-id before '.' token oop_numere_complexe.cpp:33:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ oop_numere_complexe.cpp:33:7: error: 'System' has not been declared oop_numere_complexe.cpp:33:13: error: expected ';' before '.' token using System.Linq; ^ oop_numere_complexe.cpp:33:13: error: expected unqualified-id before '.' token oop_numere_complexe.cpp:34:7: error: expected nested-name-specifier before 'System' using System.Text; ^ oop_numere_complexe.cpp:34:7: error: 'System' has not been declared oop_numere_complexe.cpp:34:13: error: expected ';' before '.' token using System.Text; ^ oop_numere_complexe.cpp:34:13: error: expected unqualified-id before '.' token oop_numere_complexe.cpp:35:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ oop_numere_complexe.cpp:35:7: error: 'System' has not been declared oop_numere_complexe.cpp:35:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ oop_numere_complexe.cpp:35:13: error: expected unqualified-id before '.' token oop_numere_complexe.cpp:41:17: error: expected ':' before 'int' private int i, r; ^ oop_numere_complexe.cpp:42:16: error: expected ':' before 'Complex' public Complex(int pr,int pi) ^ oop_numere_complexe.cpp:47:16: error: expected ':' before 'Complex' public Complex() ^ oop_numere_complexe.cpp:51:16: error: expected ':' before 'void' public void set(int pr,int pi) ^ oop_numere_complexe.cpp:56:16: error: expected ':' before 'double' public double modul() ^ oop_numere_complexe.cpp:60:16: error: expected ':' before 'int' public int real() ^ oop_numere_complexe.cpp:64:16: error: expected ':' before 'int' public int imag() ^ oop_numere_complexe.cpp:68:16: error: expected ':' before 'static' public static string afis(Complex c) ^ oop_numere_complexe.cpp:85:16: error: expected ':' before 'static' public static Complex operator +(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:85:64: error: 'static pbinfo_3539::Complex pbinfo_3539::Complex::operator+(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static Complex operator +(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:92:16: error: expected ':' before 'static' public static Complex operator -(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:92:64: error: 'static pbinfo_3539::Complex pbinfo_3539::Complex::operator-(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static Complex operator -(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:99:16: error: expected ':' before 'static' public static Complex operator *(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:99:64: error: 'static pbinfo_3539::Complex pbinfo_3539::Complex::operator*(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static Complex operator *(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:106:16: error: expected ':' before 'static' public static bool operator <(Complex c1,Complex c2) ^ oop_numere_complexe.cpp:106:60: error: 'static bool pbinfo_3539::Complex::operator<(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static bool operator <(Complex c1,Complex c2) ^ oop_numere_complexe.cpp:110:16: error: expected ':' before 'static' public static bool operator >(Complex c1,Complex c2) ^ oop_numere_complexe.cpp:110:60: error: 'static bool pbinfo_3539::Complex::operator>(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static bool operator >(Complex c1,Complex c2) ^ oop_numere_complexe.cpp:114:16: error: expected ':' before 'static' public static bool operator ==(Complex c1,Complex c2) ^ oop_numere_complexe.cpp:114:61: error: 'static bool pbinfo_3539::Complex::operator==(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static bool operator ==(Complex c1,Complex c2) ^ oop_numere_complexe.cpp:120:16: error: expected ':' before 'static' public static bool operator !=(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:120:62: error: 'static bool pbinfo_3539::Complex::operator!=(pbinfo_3539::Complex, pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static bool operator !=(Complex c1, Complex c2) ^ oop_numere_complexe.cpp:126:5: error: expected ';' after class definition } ^ oop_numere_complexe.cpp: In member function 'double pbinfo_3539::Complex::modul()': oop_numere_complexe.cpp:58:20: error: 'Math' was not declared in this scope return Math.Sqrt(Math.Pow(r, 2) + Math.Pow(i, 2)); ^ oop_numere_complexe.cpp: In static member function 'static std::string pbinfo_3539::Complex::afis(pbinfo_3539::Complex)': oop_numere_complexe.cpp:71:28: error: request for member 'ToString' in 'c.pbinfo_3539::Complex::r', which is of non-class type 'int' return c.r.ToString() + "+" + c.i.ToString() + "i"; ^ oop_numere_complexe.cpp:71:51: error: request for member 'ToString' in 'c.pbinfo_3539::Complex::i', which is of non-class type 'int' return c.r.ToString() + "+" + c.i.ToString() + "i"; ^ oop_numere_complexe.cpp:75:32: error: request for member 'ToString' in 'c.pbinfo_3539::Complex::r', which is of non-class type 'int' return c.r.ToString() + c.i.ToString() + "i"; ^ oop_numere_complexe.cpp:75:49: error: request for member 'ToString' in 'c.pbinfo_3539::Complex::i', which is of non-class type 'int' return c.r.ToString() + c.i.ToString() + "i"; ^ oop_numere_complexe.cpp:78:32: error: request for member 'ToString' in 'c.pbinfo_3539::Complex::r', which is of non-class type 'int' return c.r.ToString(); ^ oop_numere_complexe.cpp:81:32: error: request for member 'ToString' in 'c.pbinfo_3539::Complex::i', which is of non-class type 'int' return c.i.ToString() + "i"; ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:129:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ oop_numere_complexe.cpp:162:5: error: expected ';' after class definition } ^ oop_numere_complexe.cpp: In static member function 'static void pbinfo_3539::Program::Main(std::string*)': oop_numere_complexe.cpp:143:17: error: expected primary-expression before 'int' n = int.Parse(Console.ReadLine()); ^ oop_numere_complexe.cpp:143:17: error: expected ';' before 'int' oop_numere_complexe.cpp:144:19: error: expected unqualified-id before '[' token string[] sep = new string[] { " " }; ^ oop_numere_complexe.cpp:145:19: error: expected unqualified-id before '[' token string[] citire; ^ oop_numere_complexe.cpp:146:20: error: expected unqualified-id before '[' token Complex[] v = new Complex[n + 1]; ^ oop_numere_complexe.cpp:149:17: error: 'citire' was not declared in this scope citire = Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries); ^ oop_numere_complexe.cpp:149:26: error: 'Console' was not declared in this scope citire = Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries); ^ oop_numere_complexe.cpp:149:51: error: 'sep' was not declared in this scope citire = Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries); ^ oop_numere_complexe.cpp:149:56: error: 'StringSplitOptions' was not declared in this scope citire = Console.ReadLine().Split(sep, StringSplitOptions.RemoveEmptyEntries); ^ oop_numere_complexe.cpp:150:17: error: 'v' was not declared in this scope v[i] = new Complex(int.Parse(citire[0]), int.Parse(citire[1])); ^ oop_numere_complexe.cpp:150:36: error: expected primary-expression before 'int' v[i] = new Complex(int.Parse(citire[0]), int.Parse(citire[1])); ^ oop_numere_complexe.cpp:150:58: error: expected primary-expression before 'int' v[i] = new Complex(int.Parse(citire[0]), int.Parse(citire[1])); ^ oop_numere_complexe.cpp:154:24: error: 'v' was not declared in this scope if(v[i]>v[j]) ^ oop_numere_complexe.cpp:160:13: error: 'Console' was not declared in this scope Console.ReadLine(); ^
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ă.