Ha Cong Hau
unread,Nov 15, 2012, 8:48:05 AM11/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ky_thuat_...@googlegroups.com
Em viết chương trình trên VS 2012
mà e kiểm tra lại e gọi hàm đúng nhưng nó lại kêu lỗi tại output xin thầy giúp đở?
// TamGiacPasCal.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "conio.h"
#include "stdio.h"
long unsigned gt(int a)
{
return(a>1) ? a*gt(a-1):1;
}
long unsigned tohop(int n, int k)
{
return(gt(n)/(gt(k)*gt(n-k)));
}
long unsigned cbt(int n, int k)
{
return(tohop(n-1,k-1)+tohop(n-1,k));
}
void output(int n,int i,int j)
{
for (i=0;i<n;i++) printf("\n");
{
for (j=0;j<i;i++) printf("%ld\t",cbt(i,j));
}
}
int _tmain(int argc, _TCHAR* argv[])
{
int n;
scanf_s("%d",n);
output(n);
return 0;
}