为什么结果是这个?
程序代码:
# include <stdio.h> typedef struct ElemType { char name[10]; int arriveTime; int cpuTime; int alreadyTime; int needTime; char state; }ElemType; int main(void){ int i = 0; int TOTALTIME = 0; ElemType a[300] = {0}; printf("请输入进程名[name],到达时间[arriveTime]和执行时间[cpuTime](以空格隔开)\n"); for(i=0; i<2; i++) { scanf("%s", &(a[i].name)); scanf("%d", &(a[i].arriveTime)); scanf("%d", &(a[i].cpuTime)); a[i].alreadyTime = 0; a[i].needTime = a[i].cpuTime ; a[i].state = 'w'; TOTALTIME += a[i].cpuTime; } printf("%d\n", sizeof(ElemType)); for (i=0; i<2; i++) printf("%d ", a[i]); return 0; }请输入进程名[name],到达时间[arriveTime]和执行时间[cpuTime](以空格隔开)
1 2 3
2 4 5
32
49 50 请按任意键继续. . .
[ 本帖最后由 Heart→M鹏 于 2011-12-6 00:54 编辑 ]