#867
Generare2_cu_Coada
Se dau patru numere naturale n a x y
. Să se afișeze elementele mulțimii M
, cu următoarele proprietăți:
M
sunt numere naturale mai mici sau egale cu n
;a
se află în M
;b
se află în M
, atunci b+x
și b+y
se află în M
.Problema | Generare2_cu_Coada | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #38123466 | Utilizator | |
Fișier | generare2_cu_coada.cpp | Dimensiune | 1.66 KB |
Data încărcării | 30 Septembrie 2022, 11:33 | Scor / rezultat | Eroare de compilare |
generare2_cu_coada.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ generare2_cu_coada.cpp:1:7: error: 'System' has not been declared generare2_cu_coada.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections; ^ generare2_cu_coada.cpp:2:7: error: 'System' has not been declared generare2_cu_coada.cpp:2:13: error: expected ';' before '.' token using System.Collections; ^ generare2_cu_coada.cpp:2:13: error: expected unqualified-id before '.' token generare2_cu_coada.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ generare2_cu_coada.cpp:3:7: error: 'System' has not been declared generare2_cu_coada.cpp:3:13: error: expected ';' before '.' token using System.Collections.Generic; ^ generare2_cu_coada.cpp:3:13: error: expected unqualified-id before '.' token generare2_cu_coada.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ generare2_cu_coada.cpp:4:7: error: 'System' has not been declared generare2_cu_coada.cpp:4:13: error: expected ';' before '.' token using System.Linq; ^ generare2_cu_coada.cpp:4:13: error: expected unqualified-id before '.' token generare2_cu_coada.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Text; ^ generare2_cu_coada.cpp:5:7: error: 'System' has not been declared generare2_cu_coada.cpp:5:13: error: expected ';' before '.' token using System.Text; ^ generare2_cu_coada.cpp:5:13: error: expected unqualified-id before '.' token generare2_cu_coada.cpp:6:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ generare2_cu_coada.cpp:6:7: error: 'System' has not been declared generare2_cu_coada.cpp:6:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ generare2_cu_coada.cpp:6:13: error: expected unqualified-id before '.' token generare2_cu_coada.cpp:12:26: error: 'string' has not been declared static void Main(string[] args) ^ generare2_cu_coada.cpp:12:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ generare2_cu_coada.cpp:56:5: error: expected ';' after class definition } ^ generare2_cu_coada.cpp: In static member function 'static void p30_coada::Program::Main(int*)': generare2_cu_coada.cpp:23:16: error: expected unqualified-id before '[' token int[] ap; ^ generare2_cu_coada.cpp:25:13: error: 'Queue' was not declared in this scope Queue<int> q = new Queue<int>(); ^ generare2_cu_coada.cpp:25:19: error: expected primary-expression before 'int' Queue<int> q = new Queue<int>(); ^ generare2_cu_coada.cpp:25:19: error: expected ';' before 'int' generare2_cu_coada.cpp:26:13: error: 'string' was not declared in this scope string linie = Console.ReadLine(); ^ generare2_cu_coada.cpp:26:20: error: expected ';' before 'linie' string linie = Console.ReadLine(); ^ generare2_cu_coada.cpp:27:20: error: expected primary-expression before ']' token string[] w = linie.Split(new char [] {' '}, StringSplitOptions.RemoveEmptyEntries); ^ generare2_cu_coada.cpp:27:22: error: expected ';' before 'w' string[] w = linie.Split(new char [] {' '}, StringSplitOptions.RemoveEmptyEntries); ^ generare2_cu_coada.cpp:27:55: error: expected primary-expression before ',' token string[] w = linie.Split(new char [] {' '}, StringSplitOptions.RemoveEmptyEntries); ^ generare2_cu_coada.cpp:27:57: error: 'StringSplitOptions' was not declared in this scope string[] w = linie.Split(new char [] {' '}, StringSplitOptions.RemoveEmptyEntries); ^ generare2_cu_coada.cpp:27:94: error: expected ';' before ')' token string[] w = linie.Split(new char [] {' '}, StringSplitOptions.RemoveEmptyEntries); ^ generare2_cu_coada.cpp:28:17: error: expected primary-expression before 'int' n = int.Parse(w[0]); ^ generare2_cu_coada.cpp:28:17: error: expected ';' before 'int' generare2_cu_coada.cpp:29:17: error: expected primary-expression before 'int' a = int.Parse(w[1]); ^ generare2_cu_coada.cpp:29:17: error: expected ';' before 'int' generare2_cu_coada.cpp:30:17: error: expected primary-expression before 'int' x = int.Parse(w[2]); ^ generare2_cu_coada.cpp:30:17: error: expected ';' before 'int' generare2_cu_coada.cpp:31:17: error: expected primary-expression before 'int' y = int.Parse(w[3]); ^ generare2_cu_coada.cpp:31:17: error: expected ';' before 'int' generare2_cu_coada.cpp:33:13: error: 'ap' was not declared in this scope ap = new int[n + 1]; ^ generare2_cu_coada.cpp:36:25: error: 'q' was not declared in this scope if (a <= n) q.Enqueue(a); ^ generare2_cu_coada.cpp:38:20: error: 'q' was not declared in this scope while (q.Count > 0) ^ generare2_cu_coada.cpp:54:33: error: 'Console' was not declared in this scope if (ap[i] == 1) Console.Write(i + " "); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Generare2_cu_Coada 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ă.