① 电影院售票的求大虾们帮我做一个电影院售票系统(C#,java都行)CS或者BS结构都行 ,很急 请大虾们帮帮忙
这是我以前写的
#include<stdio.h>
#include<string.h>
#defineN99//票数容量
structDate
{
intyear;
intmonth;
intday;
};
structWord
{
charmovie[20];//片名
structDatetime;//上映日期
intprice;//票价
intspare;//剩余票数
}a[N],t;
voidnewticket(FILE*fp)
{
printf("片名:");
scanf("%s",t.movie);
printf("日期:(例如2014125) ");
scanf("%d%d%d",&t.time.year,&t.time.month,&t.time.day);
printf("票价:");
scanf("%d",&t.price);
printf("剩余票数:");
scanf("%d",&t.spare);
if(t.spare!=0)//余票不为0
fprintf(fp,"%-20s%4d-%02d-%02d%3d%3d ",t.movie,t.time.year,
t.time.month,t.time.day,t.price,t.spare);
fclose(fp);
}
voidlook(FILE*fp)
{
inti,n=0;
// charch;
fclose(fp);
fp=fopen("电影票.txt","r");
for(i=0;i<N;i++)
{
fscanf(fp,"%s%d-%d-%d%d%d ",a[i].movie,&a[i].time.year,
&a[i].time.month,&a[i].time.day,&a[i].price,&a[i].spare);
if(a[i].spare>0)n++;
}
for(i=0;i<n;i++)
printf("%-20s%4d-%02d-%02d%3d%3d ",a[i].movie,a[i].time.year,
a[i].time.month,a[i].time.day,a[i].price,a[i].spare);
fclose(fp);
}
voidmenu()
{
printf("========电影票管理系统======== ");
printf("1.添加售票2.余票查询 0.退出程序 ");
printf("============================== ");
printf("功能选项:");
}
intmain()
{
FILE*fp;
charc;
while(1)
{
menu();
scanf("%c",&c);
fp=fopen("电影票.txt","a+");
switch(c)
{
case'1':newticket(fp);break;
case'2':look(fp);break;
case'0':return0;
}
}
}