本文共 530 字,大约阅读时间需要 1 分钟。
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,n;
clrscr(); //to clear the screen
printf(“How many lines?”);
scanf(“%d”,&n);
for(i=0;i<n;++i)
{
printf(“n”);
for(j=0;j<i;++j)
printf(” “);
for(k=n;k>i;–k)
printf(“*”);
}
getch(); //to stop the screen
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,n;
clrscr(); //to clear the screen
printf(“How many lines?”);
scanf(“%d”,&n);
for(i=0;i<n;++i)
{
printf(“n”);
for(j=0;j<i;++j)
printf(” “);
for(k=n;k>i;–k)
printf(“*”);
}
getch(); //to stop the screen
}
翻译自:
转载地址:http://urwwd.baihongyu.com/