+ 2
C++ query ,help me
#include <iostream> using namespace std; int main() { string smiley = " @@@@ @@@@\n" " @@@@@@ @@@@@@\n" " @@@@@@ @@@@@@\n" " @@@@ @@@@\n" "\n" "\n" "\n" " @ @\n" " @@ @@\n" " @@@ @@@\n" "@@@@@ @@@@@\n" " @@@@@@@@@@@@@@@@\n"; cout << smiley; return 0; } I'm unable to solve it. đđ The output will full smiley face.
3 Answers
+ 2
Hi.
Hope that you are doing fine.
Your C++ code is almost correct, but there are some minor adjustments needed for proper alignment of the smiley face. Here is the corrected code:
#include <iostream>
using namespace std;
int main() {
string smiley =
" @@@@ @@@@\n"
" @@@@@@ @@@@@@\n"
" @@@@@@ @@@@@@\n"
" @@@@ @@@@\n"
"\n"
"\n"
"\n"
" @@@@ @@@@\n"
" @@@@@@ @@@@@@\n"
" @@@@@@@@ @@@@@@@@\n"
"@@@@@@@@@@ @@@@@@@@@@\n"
" @@@@@@@@@@@@@@@@@@\n";
cout << smiley;
return 0;
}
+ 1
as i remember this was a question in a course. You not have to edit the face itself. I think it just ask you to print it , nothing more. So just reset the code and only print it like you have at the end.
0
it might be cuz your device screen is not perfect for running the code, try to make it smaller which will be suitable for your device