Welcome @magios!! 
As @codeneutrino said, when you ask a question in the forums, posting your code and a link to the lesson will help make your question easier to answer.
The block letters challenge confused me too, and I’m not entirely certain why they built it the way they did. My best guess is that it is simply to give you practice using std::cout <<
since users are still expected to be rather new to C++ at the point in the course when they give you the challenge.
Another way of looking at it is they simply choice one of several simple ways to display the block letters. One of which is how you proposed:
#include <iostream>
int main() {
std::cout << " ####\n## ##\n######\n## ##\n## ##\n";
}
The benifit of this method is as that you can condense the whole letter into a single std::cout
. However doing this does take away from readability, with only a single letter in my example above, it takes a bit of thought to see what letter is being printed. And If I remember correctly you have to print out multiple letters in the challenge, which could quickly become very difficult to read.
Using the method they use can make it much easier to see what letter you are printing:
#include <iostream>
int main() {
std::cout << " #### \n";
std::cout << "## ## \n";
std::cout << "###### \n";
std::cout << "## ## \n";
std::cout << "## ## \n";
}
// This displays the same as my previous example.
Due to the way it is written, you can easily see what is going to be printed so this may be the reason they chose to write std::cout
for every line .
Once you get farther into C++, a bit more advanced way to do this is using a form of multi-line strings by making a variable with they type const char*
:
#include <iostream>
int main() {
const char* block_A =
" #### \n"
"## ## \n"
"###### \n"
"## ## \n"
"## ## \n";
std::cout << block_A;
}