#2
suma_n
Să se scrie un program care citeşte de la tastatură un şir de numere naturale şi determină suma lor.
Problema | suma_n | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #30893736 | Utilizator | |
Fișier | suma_n.cpp | Dimensiune | 2.77 KB |
Data încărcării | 24 Septembrie 2021, 13:05 | Scor / rezultat | Eroare de compilare |
suma_n.cpp:3:7: error: expected nested-name-specifier before 'System' using System; ^ suma_n.cpp:3:7: error: 'System' has not been declared suma_n.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ suma_n.cpp:4:7: error: 'System' has not been declared suma_n.cpp:4:13: error: expected ';' before '.' token using System.Collections.Generic; ^ suma_n.cpp:4:13: error: expected unqualified-id before '.' token suma_n.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ suma_n.cpp:5:7: error: 'System' has not been declared suma_n.cpp:5:13: error: expected ';' before '.' token using System.Linq; ^ suma_n.cpp:5:13: error: expected unqualified-id before '.' token suma_n.cpp:6:7: error: expected nested-name-specifier before 'System' using System.Text; ^ suma_n.cpp:6:7: error: 'System' has not been declared suma_n.cpp:6:13: error: expected ';' before '.' token using System.Text; ^ suma_n.cpp:6:13: error: expected unqualified-id before '.' token suma_n.cpp:7:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ suma_n.cpp:7:7: error: 'System' has not been declared suma_n.cpp:7:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ suma_n.cpp:7:13: error: expected unqualified-id before '.' token suma_n.cpp:13:26: error: 'string' has not been declared static void Main(string[] args) ^ suma_n.cpp:13:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ suma_n.cpp:95:5: error: expected ';' after class definition } ^ suma_n.cpp: In static member function 'static void p06_jagged::Program::Main(int*)': suma_n.cpp:15:16: error: expected unqualified-id before '[' token int[][] a; // jagged ^ suma_n.cpp:23:13: error: 'Random' was not declared in this scope Random r = new Random(); ^ suma_n.cpp:23:20: error: expected ';' before 'r' Random r = new Random(); ^ suma_n.cpp:24:21: error: 'r' was not declared in this scope n = 4 + r.Next(12); // n=4..15 ^ suma_n.cpp:27:13: error: 'a' was not declared in this scope a = new int[n][]; ^ suma_n.cpp:27:28: error: expected primary-expression before ']' token a = new int[n][]; ^ suma_n.cpp:37:13: error: 'Console' was not declared in this scope Console.WriteLine("Afisare 1 : "); ^ suma_n.cpp:48:22: error: expected primary-expression before 'int' foreach (int[] t in a) ^ suma_n.cpp:48:34: error: 'foreach' was not declared in this scope foreach (int[] t in a) ^ suma_n.cpp:49:13: error: expected ';' before '{' token { ^ suma_n.cpp:67:16: error: expected unqualified-id before '[' token int[] x, y; ^ suma_n.cpp:68:13: error: 'x' was not declared in this scope x = new int[a[p].Length]; ^ suma_n.cpp:69:13: error: 'y' was not declared in this scope y = new int[a[q].Length]; ^ suma_n.cpp:76:27: error: 'null' was not declared in this scope a[p] = a[q] = null; ^ suma_n.cpp:88:22: error: expected primary-expression before 'int' foreach (int[] t in a) ^ suma_n.cpp:89:13: error: expected ';' before '{' token { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema suma_n 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ă.