| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1042 人关注过本帖
标题:[求助]    一个C语言编程题-->yms123转移
只看楼主 加入收藏
小雨潇潇
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-6-23
收藏
得分:0 
回复:(mp3aaa)一般没人会帮你的 这个程序似乎要写很...

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct book
{
int flag;
int number;
char name[20];
char writer[20];
char print[20];
float prince;
}book[200]

void newlib(struct book[i],int n)
{
int i;
FILE*fp;
if((fp=fopen("record.tex","wb"))==NULL)
{ printf("can not open fire\n");
exit(1)
{
printf("\n saving file\n");
fprintf(fp,"%d",n);
fprintf(fp,"\r\n");
for(i=0;i<n;i++);
{ fprintf(fp,"%d",number;"%s",name;"%s",writer;"%s",print;"%d",price);
fprintf(fp,"\r\n");
}
fclose(fp);
printf("*********save success*********\n");
}

}
}

void appendbook()
{
int n;
page_title("append a new book");
for(n=0;n<200;n++)
if(book[n].id==0) break;
printf("number:");
scanf("%d",&book[n].number);
printf("name:");
scanf("%s",&book[n].name);
printf("writer:");
scanf("%s",&book[n].writer);
printf("print:");
scanf("%s",&book[n].print);
printf("price");
scanf("%d",&book[n].price);
return confirm();
}

void delbook()
{
int n;
page_title("delete this book");
if((n=searchbook())!==1)
book[n].id=0;
printf("this book is deleted");
return_confirm();
}

void searchbook()
{
int n,i;
printf("please inputb book'number:");
scanf("%d",&i);
for(n=0;n<200;n++)
{
if (book[n].id==i)
{
printf("number:%d\n",book[n].number);
printf("name:%s\n",book[n].name);
return n;
}
}
}

void sortby price()
{int i,j,t;
FILE *fp;
if(fp=fopen=("book.txt","rb")=NULL)
{printf("cannot open the file.\n");
exit(0);
}
for(i=0;i<N;j++)
for(j=i+1;j<N;j++)
if(book[i].price<book[j].price)
{
t=book.price[i];
book[i]=book[j];
book[j]=t;
}
}

void sortby num()
{
int i,j,t;
FILE *fp;
if(fp=fopen=("book.txt","rb")=NULL)
{printf("cannot open the file.\n");
exit(0);
}
for(i=0;i<N;j++)
for(j=i+1;j<N;j++)
if(book[i].num<book[j].num)
{
t=book.num[i];
book[i]=book[j];
book[j]=t;
}
}

2007-06-30 11:53
小雨潇潇
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-6-23
收藏
得分:0 
回复:(mp3aaa)以下是引用killer_l在2007-6-25 21:0...

自立更生 艰苦创业
呵呵 我自己编的
不过 好象没法运行
各位 帮我看一下吧
好奇怪 就是运行不出来

2007-06-30 11:55
快速回复:[求助]    一个C语言编程题-->yms123转移
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015471 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved