nguyenhappy92

Vẽ tam giác cân đặc

Oct 13th, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. // Ve tam gia can dac
  2. // Khai bao cac ham thu vien neu co
  3. #include<stdio.h>
  4. #include<conio.h>
  5.  
  6. void main()
  7. {
  8. int i,j,h;
  9. printf("Nhap chieu cao tam giac can: ");
  10. scanf("%d",&h);
  11. for(i=1;i<=h;i++)
  12. {
  13. for(j=1;j<=h-i;j++) printf(" ");
  14. for(j=h-i+1;j<=h+i-1;j++) printf("*");
  15. printf("\n");
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment