#1270
b16
Se dă un număr natural în baza 16
. Să se transforme acest număr în baza 10
.
Problema | b16 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51175793 | Utilizator | |
Fișier | b16.cpp | Dimensiune | 327 B |
Data încărcării | 28 Mai 2024, 15:00 | Scor / rezultat | Eroare de compilare |
b16.cpp:3:20: error: conflicting declaration 'int s' int s[10], nr = 0, s; ^ b16.cpp:3:5: error: 's' has a previous declaration as 'int s [10]' int s[10], nr = 0, s; ^ b16.cpp: In function 'int main()': b16.cpp:5:12: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin >> s; ^ In file included from /usr/include/c++/4.8/sstream:38:0, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from b16.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [10]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ b16.cpp:6:25: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null] for(int i = 0; s[i] = NULL; i++) { ^ b16.cpp:7:35: error: 'g' was not declared in this scope if('0' <= s[i] && s[i] <= g;) { ^ b16.cpp:7:36: error: expected ')' before ';' token if('0' <= s[i] && s[i] <= g;) { ^ b16.cpp:7:37: error: expected primary-expression before ')' token if('0' <= s[i] && s[i] <= g;) { ^ b16.cpp:7:37: error: expected ';' before ')' token b16.cpp:10:9: error: 'else' without a previous 'if' else { ^ b16.cpp:14:15: error: expected '}' at end of input cout << nr; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema b16 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ă.