4

Язык программирования с++. Нужно вставить надпись

        cout << "███████████████████████████████████" << endl; 
        cout << "█─███─█───█─███────█────█─███─█───█" << endl;
        cout << "█─███─█─███─███─██─█─██─█──█──█─███" << endl;
        cout << "█─█─█─█───█─███─████─██─█─█─█─█───█" << endl;
        cout << "█─────█─███─███─██─█─██─█─███─█─███" << endl;
        cout << "██─█─██───█───█────█────█─███─█───█" << endl;
        cout << "███████████████████████████████████" << endl;
        cout << "██████████" << endl;
        cout << "█───█────█" << endl;
        cout << "██─██─██─█" << endl;
        cout << "██─██─██─█" << endl;
        cout << "██─██─██─█" << endl;
        cout << "██─██────█" << endl;
        cout << "██████████" << endl;
        cout << "██████████████" << endl;
        cout << "█───█─██─█───█" << endl;
        cout << "██─██─██─█─███" << endl;
        cout << "██─██────█───█" << endl;
        cout << "██─██─██─█─███" << endl;
        cout << "██─██─██─█───█" << endl;
        cout << "██████████████" << endl;
        cout << "█████████████████████" << endl;
        cout << "█────█────█─███─█───█" << endl;
        cout << "█─████─██─█──█──█─███" << endl;
        cout << "█─█──█────█─█─█─█───█" << endl;
        cout << "█─██─█─██─█─███─█─███" << endl;
        cout << "█────█─██─█─███─█───█" << endl;
        cout << "█████████████████████" << endl;

1 Answers1

8

Можно отображать и в UTF-8 (cp65001), но с этой кодировкой обычно больше проблем. Проще выводить в UTF-16, в этом случае не придется дополнительно возиться с кодировкой файлов и консоли, только поставить режим вывода стандартного потока:

#include <iostream>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>

int main() { ::_setmode(::_fileno(stdout), _O_U16TEXT); auto const & sz_message { L"███████████████████████████████████" L"\n" L"█─███─█───█─███────█────█─███─█───█" L"\n" L"█─███─█─███─███─██─█─██─█──█──█─███" L"\n" L"█─█─█─█───█─███─████─██─█─█─█─█───█" L"\n" L"█─────█─███─███─██─█─██─█─███─█─███" L"\n" L"██─█─██───█───█────█────█─███─█───█" L"\n" L"███████████████████████████████████" L"\n" }; ::std::wcout << sz_message << ::std::flush; ::_wsystem(L"pause"); return(0); }

введите сюда описание изображения

С пиксельным шрифтом 8х12 (в этом случае еще не будет антиалиасинга и разрывов между строками):

введите сюда описание изображения

αλεχολυτ
  • 28,987
  • 13
  • 60
  • 119
user7860670
  • 29,796