该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
fprintf(fp,"%23s%15s\n",p->num,p->name);
fclose(fp);
}
void del_name() /*定义按姓名注销旧档案函数*/
{
char tempname[10]="";
int n=0;
struct student record[N]={0},*p=NULL,*k=NULL;
FILE*fp=NULL;
fp=fopen("d:\\duli16_3.txt","r");
if(fp=NULL)
{printf("\n 打开文件失败!\n");return;}
p=record;
while(feof(fp)==0)
{
fscanf(fp,"%23s%15s\n",p->num,p->name);
p++;
n++;
}
fclose(fp);
printf("\n 请输入要注销记录的姓名:");
gets(tempname);
for(k=record;k
if(strcmp(tempname,k->name)==0) break;
if(k
for(p=k;p
*p=*(p+1);
else printf("\n 无此人!\n");
fp=fopen("d:\\duli16_3.txt","w");
if(fp==NULL)
{
printf("\n 打开文件失败!\n");return;}
for(p=record;p
fprintf(fp,"%23s%15s\n",p->num,p->name);
fclose(fp);
}
void myaddmoney() /*定义续钱函数*/
{
int i=0,n=0,m=0;
char b[10];
FILE*fp=NULL;
struct student a[50]={0};
fp=fopen("d:\\duli16_3.txt","r");
if(fp==NULL)
{ printf("\n 打开文件失败\n");return;}
while(feof(fp)==0)
{
fscanf(fp,"%d%s%10d\n",&a[n].num,&a[n].name,&a[n].money);
printf("%23d%15s%10lf\n",a[n].num,a[n].name,a[n].money);
n++;
}
printf("请输入您的学号\n");
gets(b);
printf("\n");
for(i=0;i
if(strcmp(b,a[i].num)==0)
{
printf("%23d%15s%5d\n",a[i].num,a[i].name,a[i].money);
printf("请输入续钱金额:");
scanf("%d",&m);
a[i].money=a[i].money+m;
printf("%23d%15s%5d\n",a[i].num,a[i].name,a[i].money);
}
}
void mycreatnewfaction() /*定义创新功能函数*/
{
mciSendString("open \"C:\\爱就爱.mp3\" alias file", NULL, 0, NULL);
mciSendString("play file", NULL, 0, NULL);
getchar();
}
void myout() /*定义退出系统函数*/
{
printf("\n 感谢使用本软件!已正常退出,按任意键结束。\n");
}