#4349
numere28
Scrieţi un program care, cunoscând numărul cerinței c
(egal cu 1
sau cu 2
), numărul n
și un șir de n
numere naturale, va obține:
- pentru cerința 1: Să se afișeze câte numere-munte și câte numere-vale sunt în șir.
- pentru cerința 2 : Să se afișeze cel mai mic număr-munte care este palindrom și este obținut prin utilizarea unui număr maxim de cifre diferite între ele, dintre toate cifrele conținute de numerele-munte din șir.
Olimpiada Municipală de Informatică, Iași, 2023
Problema | numere28 | Operații I/O |
numere.in /numere.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 8 MB
/
Stivă 4 MB
|
Id soluție | #48919733 | Utilizator | |
Fișier | numere28.cpp | Dimensiune | 3.60 KB |
Data încărcării | 09 Februarie 2024, 11:28 | Scor / rezultat | Eroare de compilare |
numere28.cpp:88:2: error: stray '#' in program }#include <fstream> ^ numere28.cpp: In function 'int main()': numere28.cpp:53:6: error: 'C' was not declared in this scope if(C==2){ ^ numere28.cpp:56:7: error: 'cx' was not declared in this scope cx=x; ^ numere28.cpp:76:14: error: 'cobarare' was not declared in this scope if(cobarare){ ^ numere28.cpp:78:17: error: 'cif' was not declared in this scope cif=cx%10; ^ numere28.cpp:86:9: error: expected primary-expression before '}' token }} ^ numere28.cpp:86:9: error: expected ';' before '}' token numere28.cpp: At global scope: numere28.cpp:88:3: error: 'include' does not name a type }#include <fstream> ^ numere28.cpp:91:13: error: redefinition of 'std::ifstream fin' ifstream fin("numere.in"); ^ numere28.cpp:4:10: error: 'std::ifstream fin' previously declared here ifstream fin("numere.in"); ^ numere28.cpp:92:14: error: redefinition of 'std::ofstream fout' ofstream fout("numere.out"); ^ numere28.cpp:5:10: error: 'std::ofstream fout' previously declared here ofstream fout("numere.out"); ^ numere28.cpp:94:5: error: redefinition of 'int n' int n,cif,cx, c; ^ numere28.cpp:7:5: error: 'int n' previously declared here int n, c; ^ numere28.cpp:94:15: error: redefinition of 'int c' int n,cif,cx, c; ^ numere28.cpp:7:8: error: 'int c' previously declared here int n, c; ^ numere28.cpp:95:11: error: redefinition of 'int v [1001]' int v[1001],z[9001]; ^ numere28.cpp:8:5: error: 'int v [1001]' previously declared here int v[1001],z[9001]; ^ numere28.cpp:95:19: error: redefinition of 'int z [9001]' int v[1001],z[9001]; ^ numere28.cpp:8:13: error: 'int z [9001]' previously declared here int v[1001],z[9001]; ^ numere28.cpp:96:6: error: redefinition of 'bool coborare' bool coborare; ^ numere28.cpp:9:6: error: 'bool coborare' previously declared here bool coborare; ^ numere28.cpp:97:5: error: redefinition of 'int cif1' int cif1, cif2; ^ numere28.cpp:10:5: error: 'int cif1' previously declared here int cif1, cif2; ^ numere28.cpp:97:11: error: redefinition of 'int cif2' int cif1, cif2; ^ numere28.cpp:10:11: error: 'int cif2' previously declared here int cif1, cif2; ^ numere28.cpp:98:5: error: redefinition of 'int nr_munti' int nr_munti, nr_vai; ^ numere28.cpp:11:5: error: 'int nr_munti' previously declared here int nr_munti, nr_vai; ^ numere28.cpp:98:15: error: redefinition of 'int nr_vai' int nr_munti, nr_vai; ^ numere28.cpp:11:15: error: 'int nr_vai' previously declared here int nr_munti, nr_vai; ^ numere28.cpp: In function 'int main()': numere28.cpp:100:5: error: redefinition of 'int main()' int main() { ^ numere28.cpp:13:5: error: 'int main()' previously defined here int main() { ^ numere28.cpp:163:14: error: 'cobarare' was not declared in this scope if(cobarare){ ^ numere28.cpp:173:9: error: expected primary-expression before '}' token }} ^ numere28.cpp:173:9: error: expected ';' before '}' token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema numere28 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ă.