kinsprite kinsprite
关注数: 38 粉丝数: 99 发帖数: 10,847 关注贴吧数: 11
------------ 聪明的鱼鱼,看懂的话,帮我解密一下 ---------- #include <iostream> #include <string> #include <cstdint> #include <algorithm> int main() { const int count_per_line = 4; const int part_1st_lines = 20; const std::uint8_t data[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 7, 0, 0, 248, 15, 0, 0, 28, 8, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 60, 0, 0, 0, 252, 0, 0, 0, 240, 3, 0, 0, 128, 15, 0, 0, 0, 30, 0, 0, 0, 28, 0, 0, 0, 28, 0, 0, 0, 28, 0, 0, 2, 14, 0, 0, 254, 7, 0, 0, 252, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 56, 0, 0, 0, 248, 31, 0, 0, 248, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 7, 0, 0, 248, 31, 0, 0, 56, 60, 0, 0, 56, 56, 0, 0, 56, 56, 0, 0, 56, 56, 0, 0, 56, 56, 0, 0, 56, 28, 0, 0, 248, 15, 0, 0, 248, 7, 0, 0, 56, 14, 0, 0, 56, 28, 0, 0, 56, 28, 0, 0, 56, 56, 0, 0, 56, 56, 0, 0, 56, 48, 0, 0, 56, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 224, 140, 0, 0, 255, 204, 1, 240, 31, 140, 3, 240, 6, 12, 7, 0, 6, 12, 14, 0, 6, 12, 4, 0, 6, 12, 0, 248, 255, 255, 63, 248, 255, 255, 63, 0, 6, 8, 0, 0, 6, 24, 4, 0, 6, 24, 14, 0, 198, 25, 7, 0, 254, 25, 3, 224, 63, 152, 1, 248, 7, 216, 1, 24, 6, 240, 0, 0, 6, 120, 8, 0, 6, 60, 24, 0, 6, 111, 24, 0, 198, 227, 28, 0, 246, 193, 12, 240, 39, 128, 15, 240, 3, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0 }; std::string str = "201314"; auto it_str = str.begin(); auto func_char = [&](bool b) { if (!b) { std::cout << *it_str++; if (it_str == str.end()) { it_str = str.begin(); } } else { std::cout << ' '; } }; int count = 0; auto func = [&](const std::uint8_t d) { for (int i = 0; i < 8; ++i) { bool b = (d & (1 << i)) != 0; func_char(b); func_char(b); } if (count % count_per_line == count_per_line - 1) { std::cout << std::endl; } count++; }; std::for_each(data, &data[part_1st_lines * count_per_line], func); std::for_each(data, &data[sizeof(data) / sizeof(data[0])], func); }
1 下一页