该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
#include
#include
void baocunXS(struct stu *head);
struct stu *creat();
struct stu
{
int chengji;
int xuhao;
struct stu *next;//结构体指针自引用
};
void ps(struct stu *head)
{
struct stu *p;
p=head;
if(p!=NULL)
{
do
{
printf("学号=%d 成绩=%d\n",p->xuhao,p->chengji);
p=p->next;
}while(p!=NULL);
}
}
void baocunXS(struct stu *head)
{
FILE *bcxs;
struct stu *p;
char x[30]={0};
char y[30]={0};
char z[30]={0};
p = head;
if ((bcxs = fopen("bcxs.txt", "a+")) = NULL)
{
printf("文件打开或创建失败!");</