#1353
AparitiiCifra
Determinaţi numărul de apariţii a unei cifre c
în reprezentarea tuturor numerelor mai mici sau egale cu un n
dat.
Problema | AparitiiCifra | Operații I/O |
aparitiicifra.in /aparitiicifra.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #53398753 | Utilizator | |
Fișier | aparitiicifra.cpp | Dimensiune | 693 B |
Data încărcării | 28 Octombrie 2024, 13:20 | Scor / rezultat | Eroare de compilare |
aparitiicifra.cpp:22:10: warning: character constant too long for its type [enabled by default] assign(f,'aparitiicifra.in');reset(f); ^ aparitiicifra.cpp:25:10: warning: character constant too long for its type [enabled by default] assign(f,'aparitiicifra.out');rewrite(f); ^ aparitiicifra.cpp:1:1: error: 'program' does not name a type program numere; ^ aparitiicifra.cpp:2:1: error: 'var' does not name a type var c,n:longint; ^ aparitiicifra.cpp:3:6: error: found ':' in nested-name-specifier, expected '::' f:text; ^ aparitiicifra.cpp:3:5: error: 'f' does not name a type f:text; ^ aparitiicifra.cpp:4:1: error: 'function' does not name a type function performant(c,k:longint):longint; ^ aparitiicifra.cpp:5:1: error: 'var' does not name a type var i,j,n,z:longint; ^ aparitiicifra.cpp:6:1: error: 'begin' does not name a type begin ^ aparitiicifra.cpp:7:6: error: expected unqualified-id before '{' token n:=0;{nr de aparitii a cifrei c} ^ aparitiicifra.cpp:8:1: error: 'j' does not name a type j:=1;{pornim de la ultima cifra(j=10-penultima cifra,j=100-antepenultima...)} ^ aparitiicifra.cpp:8:6: error: expected unqualified-id before '{' token j:=1;{pornim de la ultima cifra(j=10-penultima cifra,j=100-antepenultima...)} ^ aparitiicifra.cpp:9:1: error: 'z' does not name a type z:=0;{in z memoram ultimele cifre ale numarului k, care au fost extrase} ^ aparitiicifra.cpp:9:6: error: expected unqualified-id before '{' token z:=0;{in z memoram ultimele cifre ale numarului k, care au fost extrase} ^ aparitiicifra.cpp:10:1: error: expected unqualified-id before 'while' while k>=c do ^ aparitiicifra.cpp:15:2: error: 'z' does not name a type z:=z+(k mod 10)*j; ^ aparitiicifra.cpp:16:2: error: 'k' does not name a type k:=k div 10; ^ aparitiicifra.cpp:17:2: error: 'j' does not name a type j:=j*10; ^ aparitiicifra.cpp:18:2: error: 'end' does not name a type end; ^ aparitiicifra.cpp:19:1: error: 'performant' does not name a type performant:=n; ^ aparitiicifra.cpp:20:1: error: 'end' does not name a type end; ^ aparitiicifra.cpp:21:1: error: 'Begin' does not name a type Begin ^ aparitiicifra.cpp:22:35: error: expected constructor, destructor, or type conversion before '(' token assign(f,'aparitiicifra.in');reset(f); ^ aparitiicifra.cpp:23:7: error: expected constructor, destructor, or type conversion before '(' token readln(f,n,c); ^ aparitiicifra.cpp:24:6: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ aparitiicifra.cpp:25:7: error: expected constructor, destructor, or type conversion before '(' token assign(f,'aparitiicifra.out');rewrite(f); ^ aparitiicifra.cpp:25:38: error: expected constructor, destructor, or type conversion before '(' token assign(f,'aparitiicifra.out');rewrite(f); ^ aparitiicifra.cpp:26:8: error: expected constructor, destructor, or type conversion before '(' token writeln(f,performant(c,n)); ^ aparitiicifra.cpp:27:6: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ aparitiicifra.cpp:28:1: error: 'End' does not name a type End. ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AparitiiCifra 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ă.