程序运行后的结果
#include<stdio.h>structWorker{charname[15];intage;doublepay;};voidmain(){structWorker...
#include<stdio.h>
struct Worker{char name[15];int age;double pay;};
void main(){
struct Worker a[4]={{"abc",20,2420},{"defa",50,3638},
{"ghin",40,2560},{"jklt",36,2375}};
int i,s=0;
for(i=0;i<4;i++)s+=a[i].age;
printf("s=%5.2Lf\n",(double)s/4);
}
这个是最后一道了 展开
struct Worker{char name[15];int age;double pay;};
void main(){
struct Worker a[4]={{"abc",20,2420},{"defa",50,3638},
{"ghin",40,2560},{"jklt",36,2375}};
int i,s=0;
for(i=0;i<4;i++)s+=a[i].age;
printf("s=%5.2Lf\n",(double)s/4);
}
这个是最后一道了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询