xdm,这段C的代码那都错了,帮忙改改吧,实在不知道怎么改了?
Posted 绽放文化
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xdm,这段C的代码那都错了,帮忙改改吧,实在不知道怎么改了?相关的知识,希望对你有一定的参考价值。
#include<stdio.h>typedef struct STU{char num[7];char name[16];struct DATE{int year;int month;int day;}birthday;struct RECORD{int a;int b;int c;int d;}record;}stu;void main(){int n,i;scanf("%d",&n);for(i = 0; i < n; i++){scanf("%s %s %d%d%d %d%d%d",&stu[i].num,&stu[i].name,&stu[i].birthday.year,&stu[i].birthday.month,&stu[i].birthday.day,&stu[i].record.a,&stu[i].record.b,&stu[i].record.c);/* scanf("%s",&stu[i].name);scanf("%d%d%d",&stu[i].birthday.year,&stu[i].birthday.month,&stu[i].birthday.day);scanf("%d%d%d",&stu[i].record.a,&stu[i].record.b,&stu[i].record.c);*/}int rr[n];for(i = 0; i < n; i++){rr[i] = a*0.2 + b*0.3 + c*0.5;}print("num name birthday s1 s2 s3 sum\\n");for(i=0 ; i<n; i++){print("%-10s",stu[i].num);print("%-10s",stu[i].name);print("%d/%2d/%-4d",stu[i].birthday.year,stu[i].birthday.month,stu[i].birthday.day);print("%-4d\\n",rr[i]);}}
以上是关于xdm,这段C的代码那都错了,帮忙改改吧,实在不知道怎么改了?的主要内容,如果未能解决你的问题,请参考以下文章