问答题
使用VC++6.0打开
下的源程序文件2.cpp。请完成函数fun(int n),使其实现以下功能:当i等于3时,则打印如下内容。
A
AA
AAA
注意:不能修改程序的其他部分,只能修改fun()函数。
试题程序:
#include <iostream.h>
void fun(int n)
{
}
void main()
{
int n;
cout<<"请输入打印的行数: "<<endl;
cin>>n;
if( n < 1)
{
cout<<"输入的行数必须大于0"<<endl;
return;
}
fun(n);
return;
}