#include
#include
#include
using namespace std;
int main()
{
char Pieces[16] = {'H', 'e', 'l', 'o', ',', ' ', 'W', 'r', 'd', '!'}; vector Bits;
string HelloWorld = "0000000100100010001101000101011000110111001010001001";
for(unsigned long i = 0; i < HelloWorld.length(); ++i) {
Bits.push_back(bool(HelloWorld[i] - '0')); } for(unsigned long i = 0; i < Bits.size() / 4; ++i) { char SemiByte = Bits[i * 4 + 3] + Bits[i * 4 + 2] * 2 + Bits[i * 4 + 1] * 4 + Bits[i * 4] * 8; cout << Pieces[SemiByte]; } }
이게 기초적인 hello wolrd출력방법이라구
제 친구가 그러는데 사실인가요?
#include
#include
using namespace std;
int main()
{
char Pieces[16] = {'H', 'e', 'l', 'o', ',', ' ', 'W', 'r', 'd', '!'}; vector Bits;
string HelloWorld = "0000000100100010001101000101011000110111001010001001";
for(unsigned long i = 0; i < HelloWorld.length(); ++i) {
Bits.push_back(bool(HelloWorld[i] - '0')); } for(unsigned long i = 0; i < Bits.size() / 4; ++i) { char SemiByte = Bits[i * 4 + 3] + Bits[i * 4 + 2] * 2 + Bits[i * 4 + 1] * 4 + Bits[i * 4] * 8; cout << Pieces[SemiByte]; } }
이게 기초적인 hello wolrd출력방법이라구
제 친구가 그러는데 사실인가요?
- dc official App
네 사실입니다