请问这题要什么编
要显示出以下内容:
*
* *
* * *
* * * *
* * * * *
我是刚刚学的,请各位帮帮忙。
我的程序是
main()
{
int a;
char b='*';
for (a=1;a<=6;a++)
b=b||'*';
printf("%c\n",b);
getch();
}
都是显示乱码出来
要显示出以下内容:
*
* *
* * *
* * * *
* * * * *
我是刚刚学的,请各位帮帮忙。
我的程序是
main()
{
int a;
char b='*';
for (a=1;a<=6;a++)
b=b||'*';
printf("%c\n",b);
getch();
}
都是显示乱码出来
2006-12-21 16:12
[此贴子已经被作者于2006-12-21 16:36:31编辑过]

2006-12-21 16:23

2006-12-21 20:04

2006-12-23 16:47
2006-12-23 17:41
#include <stdio.h>
#include <stdlib.h>
int print(int n)
{
int i;
for(i = 0;i < n - 1;i ++)
{
putchar('*');
putchar(' ');
}
putchar('*');
putchar('\n');
return 0;
}
int main()
{
int n, i;
while(scanf("%d", &n) != EOF)
{
for(i = 1;i <= n;i ++)
print(i);
}
return 0;
}

2006-12-23 17:53
为什么我运行后会提示说"Error:unable to open include file 'stdio.h'
2006-12-24 13:01
2006-12-24 13:23

2006-12-24 13:25
为什么我运行后会提示说"Error:unable to open include file 'stdio.h'
你没有那个头文件啊???

2006-12-24 14:33