#130
SortCif
Să se scrie un program care ordonează elementele unui vector crescător după suma cifrelor.
Problema | SortCif | Operații I/O |
sortcif.in /sortcif.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #45705870 | Utilizator | |
Fișier | sortcif.cpp | Dimensiune | 1.36 KB |
Data încărcării | 19 Octombrie 2023, 13:38 | Scor / rezultat | Eroare de compilare |
sortcif.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ sortcif.cpp:1:7: error: 'System' has not been declared sortcif.cpp:2:7: error: expected nested-name-specifier before 'System' using System.IO; ^ sortcif.cpp:2:7: error: 'System' has not been declared sortcif.cpp:2:13: error: expected ';' before '.' token using System.IO; ^ sortcif.cpp:2:13: error: expected unqualified-id before '.' token sortcif.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ sortcif.cpp:3:7: error: 'System' has not been declared sortcif.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ sortcif.cpp:3:13: error: expected unqualified-id before '.' token sortcif.cpp:60:1: error: expected ';' after class definition } ^ sortcif.cpp: In static member function 'static void Program::Main()': sortcif.cpp:20:9: error: 'StreamReader' was not declared in this scope StreamReader fin = new StreamReader("sortcif.in"); ^ sortcif.cpp:20:22: error: expected ';' before 'fin' StreamReader fin = new StreamReader("sortcif.in"); ^ sortcif.cpp:21:9: error: 'StreamWriter' was not declared in this scope StreamWriter fout = new StreamWriter("sortcif.out"); ^ sortcif.cpp:21:22: error: expected ';' before 'fout' StreamWriter fout = new StreamWriter("sortcif.out"); ^ sortcif.cpp:23:17: error: expected primary-expression before 'int' int n = int.Parse(fin.ReadLine()); ^ sortcif.cpp:24:12: error: expected unqualified-id before '[' token int[] a = new int[1001]; ^ sortcif.cpp:25:12: error: expected unqualified-id before '[' token int[] v = new int[1001]; ^ sortcif.cpp:26:12: error: expected unqualified-id before '[' token int[] p = new int[1001]; ^ sortcif.cpp:27:9: error: 'string' was not declared in this scope string[] b = fin.ReadLine().Split(); ^ sortcif.cpp:27:16: error: expected primary-expression before ']' token string[] b = fin.ReadLine().Split(); ^ sortcif.cpp:27:18: error: expected ';' before 'b' string[] b = fin.ReadLine().Split(); ^ sortcif.cpp:30:13: error: 'a' was not declared in this scope a[i] = int.Parse(b[i]); ^ sortcif.cpp:30:20: error: expected primary-expression before 'int' a[i] = int.Parse(b[i]); ^ sortcif.cpp:30:20: error: expected ';' before 'int' sortcif.cpp:31:13: error: 'v' was not declared in this scope v[i] = Sum(a[i]); ^ sortcif.cpp:36:21: error: 'v' was not declared in this scope if (v[i] > v[j]) ^ sortcif.cpp:48:21: error: 'v' was not declared in this scope if (v[i] == Sum(a[j]) && cnt == 0 && p[j] != a[j]) ^ sortcif.cpp:48:33: error: 'a' was not declared in this scope if (v[i] == Sum(a[j]) && cnt == 0 && p[j] != a[j]) ^ sortcif.cpp:48:54: error: 'p' was not declared in this scope if (v[i] == Sum(a[j]) && cnt == 0 && p[j] != a[j]) ^ sortcif.cpp:50:21: error: 'fout' was not declared in this scope fout.Write(a[j] + " "); ^ sortcif.cpp:57:9: error: 'fin' was not declared in this scope fin.Close() ^ sortcif.cpp:58:9: error: expected ';' before 'fout' fout.Close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortCif 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ă.