#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 | #51498958 | Utilizator | |
Fișier | b16_rec.cpp | Dimensiune | 333 B |
Data încărcării | 28 Iunie 2024, 22:18 | Scor / rezultat | Eroare de compilare |
b16_rec.cpp:2:7: error: expected nested-name-specifier before 'name' using name space std; ^ b16_rec.cpp:2:7: error: 'name' has not been declared b16_rec.cpp:2:12: error: expected ';' before 'space' using name space std; ^ b16_rec.cpp:2:12: error: 'space' does not name a type b16_rec.cpp: In function 'int main()': b16_rec.cpp:6:5: error: 'cin' was not declared in this scope cin>>a; ^ b16_rec.cpp:8:26: error: 'I' was not declared in this scope for(int i=n-1; i>=0; I--) ^ b16_rec.cpp:10:16: error: invalid types 'int[int]' for array subscript if (a[i] >= '0' && a[i] <= '9') ^ b16_rec.cpp:10:31: error: invalid types 'int[int]' for array subscript if (a[i] >= '0' && a[i] <= '9') ^ b16_rec.cpp:11:21: error: invalid types 'int[int]' for array subscript nr = a[i] - '0'; ^ b16_rec.cpp:13:21: error: invalid types 'int[int]' for array subscript nr = a[i] - 'A' + 10; ^ b16_rec.cpp:17:13: error: expected '}' at end of input return 0; ^
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ă.