
1个回答
展开全部
void myPrint(int i)
{
for(int j,j<=i;j++)
cout<<"*"<<endl;
}
是这个意思不
{
for(int j,j<=i;j++)
cout<<"*"<<endl;
}
是这个意思不
追问
#include
/* 编写一个函数,输出参数所指定的数量的 '*'。
提示:函数的原型如下:
void printStar(int count);*/
char printStar(int count);
{int count;
char z;
scanf("%d",&count);
for(int a=0,a<=count,a++)
return '*';
}
void main()
{
char z;
int count;
printf("请输入一个正整数:");
scanf("%d",&count);
z=printStar(count);
printf("%c",z);
}错在哪?
追答
你把函数定义中加一句cout<<"*";
之后在主函数中定义一个变量,直接调用就行了,不要用 z=printStar(count);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询