#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 | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #30750307 | Utilizator | |
Fișier | suma_n.cpp | Dimensiune | 1.73 KB |
Data încărcării | 17 Septembrie 2021, 12:26 | 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:74:5: error: expected ';' after class definition } ^ suma_n.cpp: In static member function 'static void p02_instructiuni::Program::Main(int*)': suma_n.cpp:16:13: error: 'Console' was not declared in this scope Console.Write("n = "); ^ suma_n.cpp:17:17: error: expected primary-expression before 'int' n = int.Parse(Console.ReadLine()); ^ suma_n.cpp:17:17: error: expected ';' before 'int' suma_n.cpp:70:13: error: 'string' was not declared in this scope string rasp = (n % 2 == 1 ? "impar" : "par"); ^ suma_n.cpp:70:20: error: expected ';' before 'rasp' string rasp = (n % 2 == 1 ? "impar" : "par"); ^ suma_n.cpp:71:31: error: 'rasp' was not declared in this scope Console.WriteLine(rasp); ^
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ă.