请教高手们一个问题
codeblocks吧
全部回复
仅看楼主
level 2
本人编写的一个显示 (下图)的编码,用VC6.0可以实现,但在codeblocks上显示不能使用,要用整形返回,为什么?如果用整形返回,应该返回什么?,谢谢。。。。
#include<iostream>
using namespace std;
void main()
{int i;
int a,b,j;
cout<<"请输入您想要的长度:"<<endl;
cin>>j;
if(j>=50)
{
cout<<"您输入的过大,请重新输入:"<<endl;
cin>>j;
}
for(i=1;i<=j;i++)
{
for(b=0;b<50-2*i;b++)
{cout<<" ";}
for(a=0;a<4*i-3;a++)
{
cout<<"*";
}
cout<<endl;
}
}
*
***
*****
*******
2014年10月21日 11点10分 1
level 2
抱歉,图片应该是对称的
2014年10月21日 11点10分 3
level 11
void main()

int main()
然后在main函数结尾加上return语句
2014年10月21日 11点10分 4
为什么一定要这么做?
2014年10月22日 05点10分
return后返回什么?
2014年10月22日 05点10分
回复 贝克街的小伟 :C FAQ 中文版: http://twpug.net/docs/ccfaq/ccfaq.html
2014年10月22日 06点10分
1