满意答案
chadif
2013.11.14
采纳率:52% 等级:12
已帮助:9726人
#include
#define n 10
int main()
{
int i=0, j=0;
while(i
{
while(j <= n-i)
{
printf(" ");
j++;
}
while(j <=n)
{
printf("*");
j++;
}
printf("\n");
j = 0;
i++;
}
return 0;
}
========================================================
/*
把时间都花在输出空格上,实在浪费,效率不高
或者这样
*/
#include
#include
#define n 10
int main()
{
int i=0, j=0;
while(i < n)
{
gotoxy(wherex()+n-i,wherey());
while(j <=i)
{
printf("*");
j++;
}
printf("\n");
j = 0;
i++;
}
return 0;
}
00分享举报