#1300
Hex
Andino, fiind neatent la ora de matematică, primeşte o provocare de la profesoară: să transforme un număr din baza 2 în baza 16.
Problema | Hex | Operații I/O |
![]() hex.in /hex.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48104049 | Utilizator | |
Fișier | hex.cpp | Dimensiune | 1.16 KB |
Data încărcării | 15 Ianuarie 2024, 20:41 | Scor / rezultat | Eroare de compilare |
hex.cpp: In function 'int main()': hex.cpp:38:5: error: 'fstream' was not declared in this scope fstream f("hex.in"); ^ hex.cpp:38:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from hex.cpp:1: /usr/include/c++/4.8/iosfwd:163:33: note: 'std::fstream' typedef basic_fstream<char> fstream; ^ hex.cpp:38:13: error: expected ';' before 'f' fstream f("hex.in"); ^ hex.cpp:39:5: error: 'ofstream' was not declared in this scope ofstream g("hex.out"); ^ hex.cpp:39:5: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from hex.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ hex.cpp:39:14: error: expected ';' before 'g' ofstream g("hex.out"); ^ hex.cpp:41:5: error: 'f' was not declared in this scope f>>x; ^ hex.cpp:42:45: error: 'binaryNumber' was not declared in this scope std::string HexNumber=binaryToHexSimple(binaryNumber); ^ hex.cpp:43:5: error: 'g' was not declared in this scope g<<HexNumber; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Hex 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ă.