This web page requires JavaScript to be enabled.

JavaScript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.

How to enable JavaScript?

BT-TH4

10cth1-2 November 18, 2010 youngta 1

[codes=c]
#include <stdio.h>
#include <conio.h>
void main()
{
  int n,i,j;
    printf("****Hinh Hoc****\nNhap vao gia tri n :");
    scanf("%d",&n);
  
  if (n>100)printf ("– So luong qua lon –");
  else
  {
    for (i=1;i<=n;i++)
    {  
      for (j=1;j<=(2*n-1);j++)
        if(j<=n+i-1&&j>=n-i+1)printf("* ");
        else printf ("  ");
        printf ("\n");
    }  
  }
  getch();
}
/*
tam giac rong dinh tren
    for (i=1;i<=n;i++)
    {  
      for (j=1;j<=(2*n-1);j++)
        if(i==n||j==n+i-1||j==n-i+1)printf("* ");
        else printf ("  ");
        printf ("\n");
    }
*/[/codes]


Last modified on December 9th, 2020 at 2:02 am

youngta
youngta



One respond

  1. youngta says:

    Có 1 số lỗi nhỏ trong trình bài , cá bạn xem tự chỉnh sửa giúp , thanks

Leave a Reply

Your email address will not be published. Required fields are marked *