任务一
代码:
#include <stdio.h>
#include <stdlib.h>
#include<time.h>
int jc(int a);
int rand(void);
void main()
{
srand((unsigned) time(NULL));
int n,x,y;
x=rand()%10;
y=rand()%10;
n=jc(x)+jc(y);
printf("n=x!+y!=%d\n",n);
printf("%d,%d",x,y);
}
int jc(int a)
{
int b=1;
while(a){
b=b*a;
a=a-1;
}
return b;
}
运行: