#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 | #51331797 | Utilizator | |
Fișier | aparitiicifra.cpp | Dimensiune | 775 B |
Data încărcării | 07 Iunie 2024, 18:16 | Scor / rezultat | Eroare de compilare |
aparitiicifra.cpp:43:10: warning: character constant too long for its type [enabled by default] assign(f,'aparitiicifra.in');reset(f); ^ aparitiicifra.cpp:49: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:3:1: error: 'var' does not name a type var c,n:longint; ^ aparitiicifra.cpp:5:6: error: found ':' in nested-name-specifier, expected '::' f:text; ^ aparitiicifra.cpp:5:5: error: 'f' does not name a type f:text; ^ aparitiicifra.cpp:7:1: error: 'function' does not name a type function performant(c,k:longint):longint; ^ aparitiicifra.cpp:9:1: error: 'var' does not name a type var i,j,n,z:longint; ^ aparitiicifra.cpp:11:1: error: 'begin' does not name a type begin ^ aparitiicifra.cpp:13:6: error: expected unqualified-id before '{' token n:=0;{nr de aparitii a cifrei c} ^ aparitiicifra.cpp:15:1: error: 'j' does not name a type j:=1;{pornim de la ultima cifra(j=10-penultima cifra,j=100-antepenultima...)} ^ aparitiicifra.cpp:15:6: error: expected unqualified-id before '{' token j:=1;{pornim de la ultima cifra(j=10-penultima cifra,j=100-antepenultima...)} ^ aparitiicifra.cpp:17:1: error: 'z' does not name a type z:=0;{in z memoram ultimele cifre ale numarului k, care au fost extrase} ^ aparitiicifra.cpp:17:6: error: expected unqualified-id before '{' token z:=0;{in z memoram ultimele cifre ale numarului k, care au fost extrase} ^ aparitiicifra.cpp:19:1: error: expected unqualified-id before 'while' while k>=c do ^ aparitiicifra.cpp:29:2: error: 'z' does not name a type z:=z+(k mod 10)*j; ^ aparitiicifra.cpp:31:2: error: 'k' does not name a type k:=k div 10; ^ aparitiicifra.cpp:33:2: error: 'j' does not name a type j:=j*10; ^ aparitiicifra.cpp:35:2: error: 'end' does not name a type end; ^ aparitiicifra.cpp:37:1: error: 'performant' does not name a type performant:=n; ^ aparitiicifra.cpp:39:1: error: 'end' does not name a type end; ^ aparitiicifra.cpp:41:1: error: 'Begin' does not name a type Begin ^ aparitiicifra.cpp:43:35: error: expected constructor, destructor, or type conversion before '(' token assign(f,'aparitiicifra.in');reset(f); ^ aparitiicifra.cpp:45:7: error: expected constructor, destructor, or type conversion before '(' token readln(f,n,c); ^ aparitiicifra.cpp:47:6: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ aparitiicifra.cpp:49:7: error: expected constructor, destructor, or type conversion before '(' token assign(f,'aparitiicifra.out');rewrite(f); ^ aparitiicifra.cpp:49:38: error: expected constructor, destructor, or type conversion before '(' token assign(f,'aparitiicifra.out');rewrite(f); ^ aparitiicifra.cpp:51:8: error: expected constructor, destructor, or type conversion before '(' token writeln(f,performant(c,n)); ^ aparitiicifra.cpp:53:6: error: expected constructor, destructor, or type conversion before '(' token close(f); ^ aparitiicifra.cpp:55: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ă.