kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Sunday, December 28, 2014


//in ra màn hình tam giác pascal với số hàng bất kỳ nhập vào
#include<stdio.h>
#include<conio.h>
int tohop(int n, int k)
{
if (k == 1 || k == n) return 1;
return tohop(n - 1, k - 1) + tohop(n - 1, k);
}
void main()
{
int n;
printf("N="); scanf_s("%d", &n);
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= i; j++)
{
if (j == 1)
{
for (int m = 1; m <= n - i;m++) printf("   ");
}
printf("%2d    ", tohop(i, j));
}
printf("\n\n");
}
}
28 Dec 2014

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

domain, domain name, premium domain name for sales

Popular Posts