假装这题不那么傻
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int i,a[5],sum1=0,sum=0;
srand(time(NULL));
for(i=0;i<5;i++){
a[i]=rand()%20+1;
sum1+=a[i];
}
//printf("%d ",sum1);
for(i=1;i<=20;i++){
sum+=i;
}
sum=sum-sum1+sum1;
printf("%d",sum);
return 0;
}
登录后发布评论
暂无评论,来抢沙发