求高手将下面这个用c++编写的程序改成c语言!谢谢啦!
#include<iostream>
#include<fstream>
#include<string>
#include<iomanip>
using namespace std;
#define NULL 0
int n=0; //链表节点数
bool formExist=false; //原有链表是否存在
struct Singer
{
string name;
long num;
int sum;
int mark[10];
float average;
Singer *next;
};
//创建链表
Singer *create();
//打印信息
void print(Singer *pt);
//插入节点
Singer *insert(Singer *head,Singer *sin);
//保存到文件
void save(Singer *head,char filename[]);
//菜单
void menu();
//评委打分
void grade(Singer *head,int mark[]);
//成绩排序
void rank(Singer *&head);
//欢迎
void welcome();
//按姓名查询
void inquire(Singer *head,string name);
//按编号查询
void inquire(Singer *head,long num);
//从文件导入
Singer *import(char filename[],Singer *head);
int main()
{
Singer *head=NULL;
Singer newsin;
string name;
void grade(Singer *);
ifstream infile;
char filename[20];
long num;
char choose;
bool quit=false;
char c;
welcome();
while(true)
{
menu();
cin>>choose;
switch(choose)
{
case '1':
if (formExist)
{
cout<<"您要创建新的链表,原有链表将丢失,是否继续?(Y/N)";
cin>>c;
if (!(c=='y'||c=='Y'))
continue;
else
{
n=0;
head=create();
system("pause");
break;
}
}else
{
head=create();
system("pause");
break;
}
case '2':
cout<<"请输入文件名:";
cin>>filename;
head=import(filename,head);
system("pause");
break;
case '3':
grade(head);
system("pause");
break;
case '4':
cout<<"成绩排序结果为:"<<endl;
rank(head);
system("pause");
break;
case '5':
print(head);
system("pause");
break;
case '6':
cout<<"请输入姓名:"<<endl;
cin>>name;
inquire(head,name);
system("pause");
break;
case '7':
cout<<"请输入编号:"<<endl;
cin>>num;
inquire(head,num);
system("pause");
break;
#include<iostream>
#include<fstream>
#include<string>
#include<iomanip>
using namespace std;
#define NULL 0
int n=0; //链表节点数
bool formExist=false; //原有链表是否存在
struct Singer
{
string name;
long num;
int sum;
int mark[10];
float average;
Singer *next;
};
//创建链表
Singer *create();
//打印信息
void print(Singer *pt);
//插入节点
Singer *insert(Singer *head,Singer *sin);
//保存到文件
void save(Singer *head,char filename[]);
//菜单
void menu();
//评委打分
void grade(Singer *head,int mark[]);
//成绩排序
void rank(Singer *&head);
//欢迎
void welcome();
//按姓名查询
void inquire(Singer *head,string name);
//按编号查询
void inquire(Singer *head,long num);
//从文件导入
Singer *import(char filename[],Singer *head);
int main()
{
Singer *head=NULL;
Singer newsin;
string name;
void grade(Singer *);
ifstream infile;
char filename[20];
long num;
char choose;
bool quit=false;
char c;
welcome();
while(true)
{
menu();
cin>>choose;
switch(choose)
{
case '1':
if (formExist)
{
cout<<"您要创建新的链表,原有链表将丢失,是否继续?(Y/N)";
cin>>c;
if (!(c=='y'||c=='Y'))
continue;
else
{
n=0;
head=create();
system("pause");
break;
}
}else
{
head=create();
system("pause");
break;
}
case '2':
cout<<"请输入文件名:";
cin>>filename;
head=import(filename,head);
system("pause");
break;
case '3':
grade(head);
system("pause");
break;
case '4':
cout<<"成绩排序结果为:"<<endl;
rank(head);
system("pause");
break;
case '5':
print(head);
system("pause");
break;
case '6':
cout<<"请输入姓名:"<<endl;
cin>>name;
inquire(head,name);
system("pause");
break;
case '7':
cout<<"请输入编号:"<<endl;
cin>>num;
inquire(head,num);
system("pause");
break;