打印以下图案
问题描述:
bbbb*bbbb
bbb***bbb
bb*****bb
b*******b
*********
[edit]已添加代码块 - OriginalGriff [/ edit]
[edit]Code block added - OriginalGriff[/edit]
答
-SA
我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。
亲自尝试,你可能会发现它不是和你想的一样困难!
如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但是我们不会为你做这一切!
这并不复杂:只是想想你将如何自己做,并设置两个循环,一个在另一个内。
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
This isn't complicated: just try to think about how you would do it yourself, and set up two loops, one inside the other.
这是完整而正确的解决方案:
This is the complete and correct solution:
//...
#include <stdio.h>
//...
puts("bbbb*bbbb");
puts("bbb***bbb");
puts("bb*****bb");
puts("b*******b");
puts("*********");
请参阅: http:// www .cplusplus.com / reference / cstdio / puts [ ^ ]。
可能这个解决方案比你想要的所有循环和变量更紧凑。这不是你想要的吗?然后这段代码示例应该教你正确提问。