#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 | #54052464 | Utilizator | |
Fișier | oop_numere_complexe.cpp | Dimensiune | 2.76 KB |
Data încărcării | 18 Noiembrie 2024, 19:21 | 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:40:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ oop_numere_complexe.cpp:77:5: error: expected ';' after class definition } ^ oop_numere_complexe.cpp: In static member function 'static void clase_pbinfo_3539::Program::Main(std::string*)': oop_numere_complexe.cpp:65:37: error: conversion from 'Complex*' to non-scalar type 'Complex' requested Complex a = new Complex(); ^ oop_numere_complexe.cpp:66:41: error: conversion from 'Complex*' to non-scalar type 'Complex' requested Complex b = new Complex(4, 5); ^ oop_numere_complexe.cpp:68:13: error: 'Console' was not declared in this scope Console.WriteLine("Introduceti partea reala si partea imaginara:"); ^ oop_numere_complexe.cpp:69:21: error: expected primary-expression before 'int' int x = int.Parse(Console.ReadLine()); ^ oop_numere_complexe.cpp:70:21: error: expected primary-expression before 'int' int y = int.Parse(Console.ReadLine()); ^ oop_numere_complexe.cpp:74:33: error: 'class Complex' has no member named 'Modul' Console.WriteLine(a.Modul() + " " + (a * b) + " " + (a + b) + " " + (a - b)); ^ oop_numere_complexe.cpp: At global scope: oop_numere_complexe.cpp:80:16: error: expected ':' before 'void' public void Afis() ^ oop_numere_complexe.cpp:87:16: error: expected ':' before 'Complex' public Complex(int pr,int pi) ^ oop_numere_complexe.cpp:92:16: error: expected ':' before 'Complex' public Complex() { } ^ oop_numere_complexe.cpp:93:16: error: expected ':' before 'void' public void set(int pr, int pi) ^ oop_numere_complexe.cpp:98:16: error: expected ':' before 'double' public double Modul() ^ oop_numere_complexe.cpp:102:16: error: expected ':' before 'int' public int real() ^ oop_numere_complexe.cpp:106:16: error: expected ':' before 'int' public int imag() ^ oop_numere_complexe.cpp:111:16: error: expected ':' before 'override' public override string ToString() ^ oop_numere_complexe.cpp:111:16: error: 'override' does not name a type oop_numere_complexe.cpp:116:16: error: expected ':' before 'static' public static Complex operator+(Complex x, Complex y) ^ oop_numere_complexe.cpp:116:61: error: 'static clase_pbinfo_3539::Complex clase_pbinfo_3539::Complex::operator+(clase_pbinfo_3539::Complex, clase_pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static Complex operator+(Complex x, Complex y) ^ oop_numere_complexe.cpp:123:16: error: expected ':' before 'static' public static Complex operator -(Complex x, Complex y) ^ oop_numere_complexe.cpp:123:62: error: 'static clase_pbinfo_3539::Complex clase_pbinfo_3539::Complex::operator-(clase_pbinfo_3539::Complex, clase_pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static Complex operator -(Complex x, Complex y) ^ oop_numere_complexe.cpp:130:16: error: expected ':' before 'static' public static Complex operator *(Complex x, Complex y) ^ oop_numere_complexe.cpp:130:62: error: 'static clase_pbinfo_3539::Complex clase_pbinfo_3539::Complex::operator*(clase_pbinfo_3539::Complex, clase_pbinfo_3539::Complex)' must be either a non-static member function or a non-member function public static Complex operator *(Complex x, Complex y) ^ oop_numere_complexe.cpp:137:5: error: expected ';' after class definition } ^ oop_numere_complexe.cpp: In member function 'void clase_pbinfo_3539::Complex::Afis()': oop_numere_complexe.cpp:82:13: error: 'Console' was not declared in this scope Console.WriteLine("numarul complex este:{0} + {1}*i ", re, i); ^ oop_numere_complexe.cpp: In member function 'double clase_pbinfo_3539::Complex::Modul()': oop_numere_complexe.cpp:100:20: error: 'Math' was not declared in this scope return Math.Sqrt(re * re + i * i); ^
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ă.