I want to program code and drawing No. 5 on the C + +

I want to program code and drawing No. 5 on the C + +
like this?
 
std::cout << "5";
Thank you, but I want it to appear as follows
*****
*
*
*****
*
*
****



and where is the 5 in that post?
I want to show No. 5 in the form of stars when you run the interface program in C + +
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

int main() {
   std::cout << "*****\n";
   std::cout << "*    \n";
   std::cout << "*****\n";
   std::cout << "    *\n";
   std::cout << "*****\n";

   return 0;
}
try this:

1
2
3
4
5
6
7
8
9
10
11
12
#include<iostream>

int main()
{
	std::cout << "*****" << std::endl;
	std::cout << "*" << std::endl;
	std::cout << "*" << std::endl;
	std::cout << "****" << std::endl;
	std::cout << "   **" << std::endl;
	std::cout << "  **" << std::endl;
	std::cout << "**" << std::endl;
}
I guess that was supposed to look a bit like this:
*****
*
*
*****
     *
     *
 **** 


Use code or output tags as appropriate.
In this case I would just store the text in a string, with newline '\n' included where appropriate. Then output the string.
1
2
    string five = "*****\n*\n*\n*****\n     *\n     *\n ****";
    cout << five << endl;


If you wanted several such digits on the same horizontal line, it might be better to use an array to store the entire block of text before output.
Last edited on
Thank you my friend, thank you very much
Love it thank you all
you can do it like so:
1
2
3
4
5
6
7
8
string five =
"*****\n"
"*\n"
"*\n"
"*****\n"
"     *\n"
"     *\n"
" ****";


This way you see how it looks like
http://www.cplusplus.com/forum/general/88376/

ive been trying to do something that would interest you very much

hate your code tag by the way, maybe i should change mine to
boos fascist zionists
:P
yes
thank for all
I am grateful to you
Topic archived. No new replies allowed.