Created
May 23, 2013 00:29
-
-
Save kunpengku/5631974 to your computer and use it in GitHub Desktop.
trigle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int num; | |
int i,j; | |
printf("请输入您想生成的三角形高度: "); | |
scanf("%d",&num); | |
for(i=1; i<=num; i++) | |
{ | |
for(j=1; j<2*num; j++) | |
{ | |
if(j>num-i&&j<num+i) | |
printf("%c",'*'); | |
else | |
printf(" "); | |
} | |
printf("\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment