#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 | #45810645 | Utilizator | |
Fișier | b16_rec.cpp | Dimensiune | 513 B |
Data încărcării | 22 Octombrie 2023, 16:19 | Scor / rezultat | Eroare de compilare |
b16_rec.cpp: In function 'char b16_rec(int)': b16_rec.cpp:4:17: error: 'cout' was not declared in this scope cout<<n%16;} ^ b16_rec.cpp:5:23: error: 'cout' was not declared in this scope else if(n%16==10){cout<<'A'; ^ b16_rec.cpp:7:23: error: 'cout' was not declared in this scope else if(n%16==11){cout<<'B'; ^ b16_rec.cpp:9:23: error: 'cout' was not declared in this scope else if(n%16==12){cout<<'C'; ^ b16_rec.cpp:11:23: error: 'cout' was not declared in this scope else if(n%16==13){cout<<'D'; ^ b16_rec.cpp:13:23: error: 'cout' was not declared in this scope else if(n%16==14){cout<<'E'; ^ b16_rec.cpp:15:23: error: 'cout' was not declared in this scope else if(n%16==15){cout<<'F'; ^ b16_rec.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.