标题:我是新人,请多指点!
取消只看楼主
javatom
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-5-26
 问题点数:0 回复次数:0 
我是新人,请多指点!
#include "iostream.h"
void main()
{
    for(int x=0;x<=4;x++)
    {
        for(int y=7;y>x;y--)
            cout << " ";
        for(int z=1;z<=2*x+1;z++)
            cout <<"*";
        cout<<endl;
    }

   for(x=0;x<=4;x++)
   {
       for(int y=0;y<=x+3;y++)
           cout<< " ";
       for(int z=7;z>=2*x+1;z--)
           cout<<"*";
       cout<<endl;
   }
}
有没有这样编行吗?为什么在下面的for里还要声明一次y,z?
搜索更多相关主题的帖子: 新人 
2010-05-26 17:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-308257-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.119979 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved