编程题
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 = min
printf("max=%d,mid=%d,min=%d\n", max, mid, min);
}
ABCDEFGHIJKLMN
选择题
BCDBA DBBB