Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bitset>
- std::string GetRow(char ByteTemplate, char empty, char full){
- std::string Binary = std::bitset<7>(ByteTemplate).to_string();
- std::string Row;
- for (int i = 0; i < 7; i++){
- if (Binary[i] - '0'){
- Row += full;
- }
- else{
- Row += empty;
- }
- Row += ' ';
- }
- Row[Row.size() - 1] = '\n';
- return Row;
- }
- int main(){
- std::cout << GetRow(0, '0', '1');
- for (int i = 0; i < 16; i++){
- std::cout<<GetRow(8, '0', '1');
- }
- std::cout << GetRow(0, '0', '1');
- system("PAUSE>NUL");
- }
- //mgostIH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement