#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 | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #42915998 | Utilizator | |
Fișier | b16_rec.cpp | Dimensiune | 293 B |
Data încărcării | 22 Martie 2023, 13:02 | Scor / rezultat | Eroare de compilare |
b16_rec.cpp:2:10: error: 'unsigned int std' redeclared as different kind of symbol unsigned std; ^ <built-in>:0:0: error: previous declaration of 'namespace std { }' b16_rec.cpp: In function 'void b16(unsigned int)': b16_rec.cpp:10:18: error: 'cout' was not declared in this scope if(r<10) cout<<r; ^ b16_rec.cpp:10:18: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from b16_rec.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ b16_rec.cpp:11:14: error: 'cout' was not declared in this scope else cout<<(char) ('A' +r-10); ^ b16_rec.cpp:11:14: note: suggested alternative: In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from b16_rec.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ b16_rec.cpp: In function 'int main()': b16_rec.cpp:16:5: error: expected primary-expression before 'unsigned' unsigned(int n) ^ b16_rec.cpp:16:5: error: expected ';' before 'unsigned' b16_rec.cpp:18:9: error: 'n' was not declared in this scope b16(n); ^
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ă.