用vfp编写一个函数print,打印一个学生的成绩数组,该数组中有5个学生的数据记录,每个记录包括

用vfp编写一个函数print,打印一个学生的成绩数组,该数组中有5个学生的数据记录,每个记录包括num,name,score,用主函数输入这些记录,用print函数输出这些记录。

#include "stdio.h"
#include <stdlib.h>
#define SIZE 5

struct student{
char num[20];
char name[20];
int score[3];
} stud[SIZE];

void print() /* 输出学生的信息 */
{
int i;

printf("\n");
for(i=0;i<SIZE;i++)
printf("%s %s %d %d %d\n",stud[i].num,stud[i].name,stud[i].score[0],stud[i].score[1],stud[i].score[2]);
}

void main()
{
int i;

for(i=0;i<SIZE;i++)
{
printf("第%d个学生的信息:\n",i+1);
scanf("%s%s%d%d%d",stud[i].num,stud[i].name,&stud[i].score[0],&stud[i].score[1],&stud[i].score[2]);
}
print();
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-12-23
这题 不难,明天给你写。追问

谢谢~弄明白了一点,想问一下,假如我想让函数值在文本框内显示的话,代码该怎么写?
thisform.text1.value=at("*****","*****")
这样发现不行的。。。

不好意思,看错了,以为是另一道题。。。
麻烦你了,谢谢~~

感觉好困难,拜托了