/*直角三角*/
#include <stdio.h>
#include <malloc.h>
int main(int argc, char* argv[])
{
char *s,*p;
int x,y,z,t;
printf("Please input floor:");
scanf("%d",&y);
t=y;
p=s=(char *)malloc(sizeof(char)*y+1);
while(y>=1){
s=p;
for(z=0;z<y-1;z++) s[z]=0x20;
while(z<t){s[z]='*';z++;}
s[t]='\0';
printf("%s\n",s);
y--;
}
free(s);
getch();
return 0;
}