#494
Constr1
Se dă un vector x
cu n
elemente, numere naturale. Să se construiască un alt vector, y
, cu n
elemente, cu proprietatea că y[i]
este egal cu suma elementelor din x
, cu excepția lui x[i]
.
Problema | Constr1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #35742942 | Utilizator | |
Fișier | constr1.cpp | Dimensiune | 754 B |
Data încărcării | 21 Martie 2022, 13:39 | Scor / rezultat | Eroare de compilare |
constr1.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ constr1.cpp:1:7: error: 'System' has not been declared constr1.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ constr1.cpp:2:7: error: 'System' has not been declared constr1.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ constr1.cpp:2:13: error: expected unqualified-id before '.' token constr1.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ constr1.cpp:3:7: error: 'System' has not been declared constr1.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ constr1.cpp:3:13: error: expected unqualified-id before '.' token constr1.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Text; ^ constr1.cpp:4:7: error: 'System' has not been declared constr1.cpp:4:13: error: expected ';' before '.' token using System.Text; ^ constr1.cpp:4:13: error: expected unqualified-id before '.' token constr1.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ constr1.cpp:5:7: error: 'System' has not been declared constr1.cpp:5:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ constr1.cpp:5:13: error: expected unqualified-id before '.' token constr1.cpp:11:26: error: 'string' has not been declared static void Main(string[] args) ^ constr1.cpp:11:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ constr1.cpp:32:5: error: expected ';' after class definition } ^ constr1.cpp: In static member function 'static void _498::Program::Main(int*)': constr1.cpp:13:21: error: expected primary-expression before 'int' int n = int.Parse(Console.ReadLine()); ^ constr1.cpp:14:13: error: 'string' was not declared in this scope string[] data = Console.ReadLine().Split(' '); ^ constr1.cpp:14:20: error: expected primary-expression before ']' token string[] data = Console.ReadLine().Split(' '); ^ constr1.cpp:14:22: error: expected ';' before 'data' string[] data = Console.ReadLine().Split(' '); ^ constr1.cpp:15:16: error: expected unqualified-id before '[' token int[] v = new int[n]; ^ constr1.cpp:16:16: error: expected unqualified-id before '[' token int[] y = new int[n]; ^ constr1.cpp:20:17: error: 'v' was not declared in this scope v[i] = int.Parse(data[i]); ^ constr1.cpp:20:24: error: expected primary-expression before 'int' v[i] = int.Parse(data[i]); ^ constr1.cpp:20:24: error: expected ';' before 'int' constr1.cpp:26:17: error: 'y' was not declared in this scope y[i] = s - v[i]; ^ constr1.cpp:26:28: error: 'v' was not declared in this scope y[i] = s - v[i]; ^ constr1.cpp:27:17: error: 'Console' was not declared in this scope Console.Write(y[i]+" "); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Constr1 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ă.