编程问题,,c++,,进来看下

[复制链接]
查看11 | 回复2 | 2012-11-4 13:01:20 | 显示全部楼层 |阅读模式
#include using namespace std;void out(int n,char a){ int i; for(i=1;i<=n;i++) cout<<a;}int main(){ int j,a; for(j=1;j<=4;j++) {
out(4-j,' ');out(2*j-1,'1');cout<<endl; } return 0;}只要 加一个cout<<endl;即可以,还有因为out(2*j-1,'1');...
回复

使用道具 举报

千问 | 2012-11-4 13:01:20 | 显示全部楼层
void out(int n,char a){int i;for(i=1;i<=n;i++)cout<<a<<endel;//这个地方要让它输出的时候换行}...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行