Поэтому я пытаюсь вставить Ascii Art в программу на C ++, и сделал это вручную, печатая каждую строку, но результат был совсем не похож на ascii art. Это как:
Это происходит из-за того, что символы не распознаются подсказкой, или я сделал это неправильно.
Вот искусство ASCII, которое я пытаюсь сделать:
_____/\\\\\\\\\________/\\\\\\\\\\\__________/\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\_
___/\\\\\\\\\\\\\____/\\\/////////\\\_____/\\\////////__\/////\\\///__\/////\\\///__
__/\\\/////////\\\__\//\\\______\///____/\\\/_______________\/\\\_________\/\\\_____
_\/\\\_______\/\\\___\////\\\__________/\\\_________________\/\\\_________\/\\\_____
_\/\\\\\\\\\\\\\\\______\////\\\______\/\\\_________________\/\\\_________\/\\\_____
_\/\\\/////////\\\_________\////\\\___\//\\\________________\/\\\_________\/\\\_____
_\/\\\_______\/\\\__/\\\______\//\\\___\///\\\______________\/\\\_________\/\\\_____
_\/\\\_______\/\\\_\///\\\\\\\\\\\/______\////\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\_
_\///________\///____\///////////___________\/////////__\///////////__\///////////__
Код:
cout << "_____/\\\\\\\\\________/\\\\\\\\\\\__________/\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\_ \n";
cout << " ___/\\\\\\\\\\\\\____/\\\/////////\\\_____/\\\////////__\/////\\\///__\/////\\\///__ \n";
cout << " __/\\\/////////\\\__\//\\\______\///____/\\\/_______________\/\\\_________\/\\\_____ \n";
cout << " _\/\\\_______\/\\\___\////\\\__________/\\\_________________\/\\\_________\/\\\_____ \n";
cout << " _\/\\\\\\\\\\\\\\\______\////\\\______\/\\\_________________\/\\\_________\/\\\_____ \n";
cout << " _\/\\\/////////\\\_________\////\\\___\//\\\________________\/\\\_________\/\\\_____ \n";
cout << " _\/\\\_______\/\\\__/\\\______\//\\\___\///\\\______________\/\\\_________\/\\\_____ \n";
cout << " _\///________\///____\///////////___________\/////////__\///////////__\///////////__\n";
escape-последовательности интерпретируются как отдельные специальные или другие символы, отсюда и странный вывод. "\\"
средства '\'
например.
Вы можете использовать необработанный строковый литерал:
#include <iostream>
int main()
{
std::cout << R"(
_____/\\\\\\\\\________/\\\\\\\\\\\__________/\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\_
___/\\\\\\\\\\\\\____/\\\/////////\\\_____/\\\////////__\/////\\\///__\/////\\\///__
__/\\\/////////\\\__\//\\\______\///____/\\\/_______________\/\\\_________\/\\\_____
_\/\\\_______\/\\\___\////\\\__________/\\\_________________\/\\\_________\/\\\_____
_\/\\\\\\\\\\\\\\\______\////\\\______\/\\\_________________\/\\\_________\/\\\_____
_\/\\\/////////\\\_________\////\\\___\//\\\________________\/\\\_________\/\\\_____
_\/\\\_______\/\\\__/\\\______\//\\\___\///\\\______________\/\\\_________\/\\\_____
_\/\\\_______\/\\\_\///\\\\\\\\\\\/______\////\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\_
_\///________\///____\///////////___________\/////////__\///////////__\///////////__
)" << '\n';
return 0;
}
Других решений пока нет …