求教c++的错误情况

[复制链接]
查看11 | 回复5 | 2009-2-19 11:58:32 | 显示全部楼层 |阅读模式
#include
int main()
{ std::<<*

***

*****

***
*\n";
}
以上是我的代码 老是一个错误想在显示器上显示出先递增后递减的星号中间能用回车键和空格键弄好吗? 求教高手本人是初学者啥都不懂

回复

使用道具 举报

千问 | 2009-2-19 11:58:32 | 显示全部楼层
代码:#include void DisplayAsterisk(int start, int max);int main(){ int start = 3; int max = 10; DisplayAsterisk(start, max); return 0;}void DisplayAsterisk(int start, int max){ int line = max - start; int line_count = start;for (int idx = 0; idx < line, line_count < max; ++idx, +...
回复

使用道具 举报

千问 | 2009-2-19 11:58:32 | 显示全部楼层
#include int main() { std::<<* \n*** \n***** \n*** \n*\n"; }...
回复

使用道具 举报

千问 | 2009-2-19 11:58:32 | 显示全部楼层
你可以添加空格字符串(可以多个比如“
”),换行的时候加“\n”...
回复

使用道具 举报

千问 | 2009-2-19 11:58:32 | 显示全部楼层
#includeint main() { cout<<"*"<<endl; cout<<"***"<<endl; cout<<"*****"<<endl; cout<<"***"<<endl; cout<<"*"<<endl; } 或者: #include i...
回复

使用道具 举报

千问 | 2009-2-19 11:58:32 | 显示全部楼层
#include int main() { std::<< *\n ***\n *****\n ***\n *\n "; }...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行