#2817
Identice4
C++
Subprogramul identice
are doi parametri, în această ordine, a
și b
, prin care primește câte un număr natural (10≤a≤b≤10
6
). Subprogramul afișează pe ecran toate numerele naturale din intervalul [a,b]
care au toate cifrele identice. Numerele afișate sunt separate prin câte un spațiu, iar dacă nu există astfel de numere, se afişează pe ecran mesajul nu exista
.
Scrieţi definiţia completă a subprogramului.
Subiect Bacalaureat 2017, sesiunea specială
Problema | Identice4 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48992073 | Utilizator | |
Fișier | identice4.cpp | Dimensiune | 388 B |
Data încărcării | 12 Februarie 2024, 10:43 | Scor / rezultat | Eroare de compilare |
identice4.cpp:13:5: error: stray '\342' in program while(nrct) n=10*n+c,nrct—; ^ identice4.cpp:13:5: error: stray '\200' in program identice4.cpp:13:5: error: stray '\224' in program identice4.cpp:21:9: error: stray '\342' in program cout<<p<<” “, ^ identice4.cpp:21:9: error: stray '\200' in program identice4.cpp:21:9: error: stray '\235' in program identice4.cpp:21:9: error: stray '\342' in program identice4.cpp:21:9: error: stray '\200' in program identice4.cpp:21:9: error: stray '\234' in program identice4.cpp:26:9: error: stray '\342' in program cout<<“nu exista”; ^ identice4.cpp:26:9: error: stray '\200' in program identice4.cpp:26:9: error: stray '\234' in program identice4.cpp:26:9: error: stray '\342' in program identice4.cpp:26:9: error: stray '\200' in program identice4.cpp:26:9: error: stray '\235' in program identice4.cpp: In function 'int urm(int)': identice4.cpp:13:33: warning: right operand of comma operator has no effect [-Wunused-value] while(nrct) n=10*n+c,nrct—; ^ identice4.cpp: In function 'void identice(int, int)': identice4.cpp:21:25: error: expected primary-expression before ',' token cout<<p<<” “, ^ identice4.cpp:26:18: error: 'nu' was not declared in this scope cout<<“nu exista”; ^ identice4.cpp:26:21: error: expected ';' before 'exista' cout<<“nu exista”; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Identice4 face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.