#4042
b16_rec
Se citeste un număr natural n
în baza 10
. Să se transforme acest număr în baza 16
, folosind un subprogram recursiv.
Problema | b16_rec | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #45810731 | Utilizator | |
Fișier | b16_rec.cpp | Dimensiune | 508 B |
Data încărcării | 22 Octombrie 2023, 16:22 | Scor / rezultat | Eroare de compilare |
b16_rec.cpp: In function 'void b16_rec(int)': b16_rec.cpp:4:17: error: 'returnn' was not declared in this scope returnn%16;} ^ b16_rec.cpp:5:30: error: 'A' was not declared in this scope else if(n%16==10){return A; ^ b16_rec.cpp:5:30: error: return-statement with a value, in function returning 'void' [-fpermissive] b16_rec.cpp:7:30: error: 'B' was not declared in this scope else if(n%16==11){return B; ^ b16_rec.cpp:7:30: error: return-statement with a value, in function returning 'void' [-fpermissive] b16_rec.cpp:9:29: error: expected primary-expression before '<<' token else if(n%16==12){return<<C; ^ b16_rec.cpp:9:31: error: 'C' was not declared in this scope else if(n%16==12){return<<C; ^ b16_rec.cpp:9:31: error: return-statement with a value, in function returning 'void' [-fpermissive] b16_rec.cpp:11:30: error: 'D' was not declared in this scope else if(n%16==13){return D; ^ b16_rec.cpp:11:30: error: return-statement with a value, in function returning 'void' [-fpermissive] b16_rec.cpp:13:30: error: 'E' was not declared in this scope else if(n%16==14){return E; ^ b16_rec.cpp:13:30: error: return-statement with a value, in function returning 'void' [-fpermissive] b16_rec.cpp:15:30: error: 'F' was not declared in this scope else if(n%16==15){return F; ^ b16_rec.cpp:15:30: error: return-statement with a value, in function returning 'void' [-fpermissive]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema b16_rec 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ă.