#131
SortCif2
Să se scrie un program care ordonează elementele unui vector crescător după prima cifră.
Problema | SortCif2 | Operații I/O |
sortcif2.in /sortcif2.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #43825176 | Utilizator | |
Fișier | sortcif2.cpp | Dimensiune | 1.87 KB |
Data încărcării | 18 Mai 2023, 10:52 | Scor / rezultat | Eroare de compilare |
sortcif2.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ sortcif2.cpp:1:7: error: 'System' has not been declared sortcif2.cpp:2:7: error: expected nested-name-specifier before 'System' using System.IO; ^ sortcif2.cpp:2:7: error: 'System' has not been declared sortcif2.cpp:2:13: error: expected ';' before '.' token using System.IO; ^ sortcif2.cpp:2:13: error: expected unqualified-id before '.' token sortcif2.cpp:17:16: error: expected ':' before 'bool' public bool MaiMare(Numar a) ^ sortcif2.cpp:21:16: error: expected ':' before 'Numar' public Numar(int x) ^ sortcif2.cpp:33:16: error: expected ':' before 'Numar' public Numar() ^ sortcif2.cpp:38:16: error: expected ':' before 'void' public void Scrie(StreamWriter numefis) ^ sortcif2.cpp:38:27: error: 'StreamWriter' has not been declared public void Scrie(StreamWriter numefis) ^ sortcif2.cpp:42:5: error: expected ';' after class definition } ^ sortcif2.cpp: In member function 'bool Paritate1::Numar::MaiMare(Paritate1::Numar)': sortcif2.cpp:19:25: error: request for member 'pc' in 'this', which is of pointer type 'Paritate1::Numar* const' (maybe you meant to use '->' ?) return this.pc > a.pc; ^ sortcif2.cpp: In member function 'void Paritate1::Numar::Scrie(int)': sortcif2.cpp:40:21: error: request for member 'Write' in 'numefis', which is of non-class type 'int' numefis.Write(val + " "); ^ sortcif2.cpp: At global scope: sortcif2.cpp:45:26: error: 'string' has not been declared static void Main(string[] args) ^ sortcif2.cpp:45:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ sortcif2.cpp:78:5: error: expected ';' after class definition } ^ sortcif2.cpp: In static member function 'static void Paritate1::Program::Main(int*)': sortcif2.cpp:48:13: error: 'StreamReader' was not declared in this scope StreamReader fin = new StreamReader("sortcif2.in"); ^ sortcif2.cpp:48:26: error: expected ';' before 'fin' StreamReader fin = new StreamReader("sortcif2.in"); ^ sortcif2.cpp:49:13: error: 'StreamWriter' was not declared in this scope StreamWriter fout = new StreamWriter("sortcif2.out"); ^ sortcif2.cpp:49:26: error: expected ';' before 'fout' StreamWriter fout = new StreamWriter("sortcif2.out"); ^ sortcif2.cpp:50:17: error: expected primary-expression before 'int' n = int.Parse(fin.ReadLine()); ^ sortcif2.cpp:50:17: error: expected ';' before 'int' sortcif2.cpp:51:18: error: expected unqualified-id before '[' token Numar[] v = new Numar[n + 1]; ^ sortcif2.cpp:53:13: error: 'string' was not declared in this scope string linie = fin.ReadLine(); ^ sortcif2.cpp:53:20: error: expected ';' before 'linie' string linie = fin.ReadLine(); ^ sortcif2.cpp:54:20: error: expected primary-expression before ']' token string[] nr = linie.Split(' '); ^ sortcif2.cpp:54:22: error: expected ';' before 'nr' string[] nr = linie.Split(' '); ^ sortcif2.cpp:57:17: error: 'v' was not declared in this scope v[i] = new Numar(Convert.ToInt32(nr[i])); ^ sortcif2.cpp:57:34: error: 'Convert' was not declared in this scope v[i] = new Numar(Convert.ToInt32(nr[i])); ^ sortcif2.cpp:57:50: error: 'nr' was not declared in this scope v[i] = new Numar(Convert.ToInt32(nr[i])); ^ sortcif2.cpp:63:25: error: 'v' was not declared in this scope if (v[i].MaiMare(v[j]) == true) ^ sortcif2.cpp:73:17: error: 'v' was not declared in this scope v[i].Scrie(fout); ^ sortcif2.cpp:73:28: error: 'fout' was not declared in this scope v[i].Scrie(fout); ^ sortcif2.cpp:75:13: error: 'fin' was not declared in this scope fin.Close(); ^ sortcif2.cpp:76:13: error: 'fout' was not declared in this scope fout.Close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortCif2 face parte din prima categorie. 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ă.