C语言 帮我检查下代码 很奇怪··主要功能是 用来算 排列组合数InputIn the first line , there is a integer T indicates the number of test cases.Then T cases follows in the T lines.Each case contains a character 'A' or 'C', two in

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 05:20:42
C语言 帮我检查下代码 很奇怪··主要功能是 用来算 排列组合数InputIn the first line , there is a integer T indicates the number of test cases.Then T cases follows in the T lines.Each case contains a character 'A' or 'C', two in

C语言 帮我检查下代码 很奇怪··主要功能是 用来算 排列组合数InputIn the first line , there is a integer T indicates the number of test cases.Then T cases follows in the T lines.Each case contains a character 'A' or 'C', two in
C语言 帮我检查下代码 很奇怪··
主要功能是 用来算 排列组合数
Input
In the first line , there is a integer T indicates the number of test cases.
Then T cases follows in the T lines.
Each case contains a character 'A' or 'C', two integers represent n and m. (1

C语言 帮我检查下代码 很奇怪··主要功能是 用来算 排列组合数InputIn the first line , there is a integer T indicates the number of test cases.Then T cases follows in the T lines.Each case contains a character 'A' or 'C', two in
int main()
{
int t,m,n,tmp;
long long *r = NULL;
char ch;
scanf("%d",&t);
tmp = t;
r = malloc(t * sizeof(long long));
if(r == NULL)
return 0;
do
{
scanf("%c%d%d%",&ch,&n,&m);
if(ch=='A') r[tmp - t - 1]=A(n,m);
if(ch=='C') r[tmp - t - 1]=C(n,m);
}while(t--);
t = tmp;
while(t--)
printf("%d\n", r[tmp - t - 1]);
return 0;
}
刚没看清题目 重新修改了下