急求c语言程序设计试题答案

2024-11-22 07:58:11
推荐回答(3个)
回答(1):

编程题
1!+2!+3!+……n!=
#include"stdio.h"
void main()
{
int i=1,m=1,n,s=0;
printf("input n:");
scanf("%d",&n);
while(i<=n)
{
m=m*i;
s=s+m;
i++;
}
printf("1!+2!+3!+……n!=%d",s);
}
三个数排序
#include"stdio.h"
void main()
{
int a,b,c;
int max, mid, min;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
max = a>b?a:b;
max = max>c?max:c;
min = amin = minmid = a+b+c-max-min;
printf("max=%d,mid=%d,min=%d\n", max, mid, min);
}

回答(2):

ABCDEFGHIJKLMN

回答(3):

选择题
BCDBA DBBB