计算机程序设计基础( c语言)习题 读程序写结果
6.
#include
char name[10]; float score;
}stu[3]={{1,\main() { int i;
float total=0.0; for(i=0;i<3;i++)
total=total+stu[i].score;
printf(\}
运行结果是:
The total scores is:260.5 7.
#include
{ struct date
{ int year, month, day; } today; union
{ long i; int k; char ii; } mix;
printf(“date:%d\\n”,sizeof(struct date)); printf(“mix:%d\\n”,sizeof(mix)); }
(提示:long 型变量占4个字节,int 型变量占2个字节,char型变量占1个字节) 运行结果是: date: 6 mix: 4
26 共26页