#3303
Pentru un număr dat x, considerăm următoarele noțiuni:
x reprezintă numărul scris cu cifrele lui x în ordine inversă;x reprezintă diferența dintre numărul format cu atâtea cifre de 9 câte cifre are x și numărul x;x este curat dacă oglinditul său este egal cu urma sa. De exemplu, 27 este un număr curat.Se dau cel mult 1000 numere naturale mai mici decât 100.000.000. Să se stabilească despre fiecare număr dacă este sau nu curat.
| Problema | nrcurat | Operații I/O |
nrcurat.in/nrcurat.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #43481320 | Utilizator | |
| Fișier | nrcurat.cpp | Dimensiune | 1.38 KB |
| Data încărcării | 28 Aprilie 2023, 10:52 | Scor/rezultat | Eroare de compilare |
nrcurat.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ nrcurat.cpp:1:7: error: 'System' has not been declared nrcurat.cpp:2:7: error: expected nested-name-specifier before 'System' using System.IO; ^ nrcurat.cpp:2:7: error: 'System' has not been declared nrcurat.cpp:2:13: error: expected ';' before '.' token using System.IO; ^ nrcurat.cpp:2:13: error: expected unqualified-id before '.' token nrcurat.cpp:7:16: error: expected ':' before 'static' public static int Ogl(int n) ^ nrcurat.cpp:17:16: error: expected ':' before 'static' public static int Nr9(int n) ^ nrcurat.cpp:27:26: error: 'string' has not been declared static void Main(string[] args) ^ nrcurat.cpp:27:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ nrcurat.cpp:54:5: error: expected ';' after class definition } ^ nrcurat.cpp: In static member function 'static void ceva::Program::Main(int*)': nrcurat.cpp:29:13: error: 'StreamReader' was not declared in this scope StreamReader fin = new StreamReader("nrcurat.in"); ^ nrcurat.cpp:29:26: error: expected ';' before 'fin' StreamReader fin = new StreamReader("nrcurat.in"); ^ nrcurat.cpp:30:13: error: 'StreamWriter' was not declared in this scope StreamWriter fout = new StreamWriter("nrcurat.out"); ^ nrcurat.cpp:30:26: error: expected ';' before 'fout' StreamWriter fout = new StreamWriter("nrcurat.out"); ^ nrcurat.cpp:31:13: error: 'string' was not declared in this scope string sir = fin.ReadLine(); ^ nrcurat.cpp:31:20: error: expected ';' before 'sir' string sir = fin.ReadLine(); ^ nrcurat.cpp:32:20: error: expected primary-expression before ']' token string[] nrt = sir.Split(' '); ^ nrcurat.cpp:32:22: error: expected ';' before 'nrt' string[] nrt = sir.Split(' '); ^ nrcurat.cpp:33:16: error: expected unqualified-id before '[' token int[] v = new int[1000]; ^ nrcurat.cpp:35:33: error: 'nrt' was not declared in this scope for (int i = 0; i < nrt.Length; i++) ^ nrcurat.cpp:37:17: error: 'v' was not declared in this scope v[i] = Convert.ToInt32(nrt[i]); ^ nrcurat.cpp:37:24: error: 'Convert' was not declared in this scope v[i] = Convert.ToInt32(nrt[i]); ^ nrcurat.cpp:39:33: error: 'nrt' was not declared in this scope for (int i = 0; i < nrt.Length; i++) ^ nrcurat.cpp:41:25: error: 'v' was not declared in this scope if (Ogl(v[i]) == Nr9(v[i]) - v[i]) ^ nrcurat.cpp:49:17: error: 'fout' was not declared in this scope fout.Write(curat + " "); ^ nrcurat.cpp:51:13: error: 'fin' was not declared in this scope fin.Close(); ^ nrcurat.cpp:52:13: error: 'fout' was not declared in this scope fout.Close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nrcurat 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ă.