| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 900 人关注过本帖
标题:[求助]各位达人,能帮小弟画出这个程序的N\S流程图吗?万分感谢
只看楼主 加入收藏
pppppkkkkkk
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-7-26
收藏
 问题点数:0 回复次数:5 
[求助]各位达人,能帮小弟画出这个程序的N\S流程图吗?万分感谢


#include <stdio.h>
#include <conio.h>
#include <bios.h>
#include <dos.h>
#include <malloc.h>
#define NULL 0
#define LEN sizeof(struct mcd)
struct data /*声明一个日期的结构体类型*/
{
int year;
int month;
int day;
};
struct mcd
{
int code;
char name[12];
long price;
int num;
char place[20];
struct data putdate;
struct data selldate;
struct mcd * next;
};
int n;
struct mcd *head;

creat()
{
struct mcd *p1,*p2;
n=0;
p1=p2=(struct mcd *)malloc(LEN);
head=p1;
loop: {
clrscr();
printf("shangpinluruxitong\n");
printf("luruhao:%d\n",n+1);
printf("bianma:");
scanf("%d",&p1->code);
printf("pinming:");
scanf("%s",&p1->name);
printf("danjia:");
scanf("%ld",&p1->price);
printf("shuliang:");
scanf("%d",&p1->num);
printf("chandi:");
scanf("%s",&p1->place);
printf("rukushijian:");
scanf("%d-%d-%d",&p1->putdate.year,&p1->putdate.month,&p1->putdate.day);
}
while(p1->num!=0)
{
n=n+1;
if(n==1)head=p1;
else p2->next=p1;
p2=p1;
p1=(struct mcd *)malloc(LEN);
goto loop;
}
p2->next=NULL;
main();
}

print()
{
int m=0;
struct mcd *p;
clrscr();
printf("bianhao||pinming||danjia||shuliang||chandi ||rukushijian\n");
p=head;
if(head!=NULL)
do
{
printf("%-10d%-14s%-12ld%-10d%-22s%-4d-%-2d-%-2d\n",p->code,p->name,p->price,p->num,p->place,p->putdate.year,p->putdate.month,p->putdate.day);
p=p->next;
m=m+1;
if(m%23==0){gotoxy(10,25);printf("anrenyijianjixu.");getch();}
}while(p!=NULL);
getch();
main();
}

sell()
{
int code,m=3,ch;
long sum=0;
struct mcd *p1;
struct date today;
getdate(&today);
clrscr();
printf("shangpinxiaoshouxitong\n");
printf("bianhao||||pinming||||chandi ||||danjia(yuan)||||chushoushijian\n");
loop:
do{
gotoxy(23,25);
printf("anrenyijianjixu,F2jiezhang,ESCjiantuichu");
ch=bioskey(0);
}while(0);
switch(ch)
{
case 15360:{
if(sum==0)
{
gotoxy(1,m);printf("haimeigoumeishangpin!");
getch();
sell();
break;
}
else {
gotoxy(1,m);
printf("------------------------------------------------------------------------------");
gotoxy(47,m+1);
printf("zongjia: %-12ldyuan",sum);
getch();
main();
break;
}
}
case 283:{main();break;}
default:
{
gotoxy(23,25);
printf("qingshueushangpinbianma,huixiangshishangpinxinxi");
gotoxy(1,m);
scanf("%d",&code);
if(head==NULL)
{
printf("nihaimeiyoujinhuo.");
getch();
main();
break;
}
p1=head;
while(code!=p1->code&&p1->next!=NULL)
{p1=p1->next;}
if(code==p1->code)
{
gotoxy(13,m);
printf("%-16s%-24s%-16ld%4d-%2d-%2d",p1->name,p1->place,p1->price,today.da_year,today.da_mon,today.da_day);
m=m+1;
p1->num=p1->num-1;
sum=sum+p1->price;
}
}
goto loop;
}
n=n+1;
print();
}

del()
{
int code;
struct mcd *p1,*p2;
clrscr();
printf("qingshuruyaoshanchushangpindebianhao:");
scanf("%d",&code);
if(head==NULL)
{
printf("nihaimeiyoujinhuo.");
getch();
main();
}
p1=head;
while(code!=p1->code&&p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if(code==p1->code)
{
if(code==head)head=p1->next;
else p2->next=p1->next;
n=n-1;
print();
}
else
{
printf("zhaobudaozhetiaoshangpinxinxi.");
getch();
print();
}
}

main()
{
do{
clrscr();
printf(" . : : \n");
printf(" '. :'''''''': : : :'''':'''':\n");
printf(" '. : : :'''''' :'''''' : : :\n");
printf(" ................ : : :', :', ''''':''''': : :\n");
printf(" '. .' : : : ', : ', : :....:....:\n");
printf(" '. .' : : ,' ,' : : : :\n");
printf(" '.' : : ', : : : :\n");
printf(".........:........... :........: : ', : :....:....:\n");
printf(" ............... :''''''''''''''': '''':'''' : \n");
printf(" : , , : :'''''': :'''''': ,' : : \n");
printf(" : , , : : : : : :''''''''': : ,' : \n");
printf(" : , , : : : : : : : : ,' ....:.... \n");
printf(" :, :''''''': : : : : : : : :,' : \n");
printf(" : : : : : : : : :'''''''''' ,' : \n");
printf(" : : : : : : : : :.......... ,' : \n");
printf(" : :.......: : : : : : : : ' : \n");
printf(" : : : : : : : : ......:.....\n");
printf(" : ..: :......: :......: :.........: \n");
gotoxy(60,19);
printf("zhaofeiyuzhizhao V1.0");
gotoxy(10,21);
printf("1,xiaoshouxitong;2,jinhuoxitong;3,chakanliebiao;4,charushanchu;5,xiaoshouyingkui;6,bangzhuwendang");
gotoxy(32,24);
printf("anESCjiantuichu");
key();
}while(0);
}

key()
{
int ch;
loop:
do{
ch=bioskey(0);
}while(0);
switch(ch)
{
case 561:sell();break;
case 818:creat();break;
case 1075:print();break;
case 283:break;
default:
{
gotoxy(30,22);
printf("qinganshuzijianxuanzhe!");
goto loop;
}
}

}

搜索更多相关主题的帖子: 流程图 感谢 
2006-07-26 23:28
恋红尘
Rank: 1
等 级:新手上路
帖 子:47
专家分:0
注 册:2006-6-10
收藏
得分:0 
这东西画N-S不死人啊
2006-07-27 12:36
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:0 
看程序都会累死人。
楼主也应该写点解释吧,要不我们怎么画啊。
自己写的程序自己不会画?

倚天照海花无数,流水高山心自知。
2006-07-27 15:25
yuchujin
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2006-7-25
收藏
得分:0 
这么长?


........晕 这个BBS不能贴图.......... G-G-G-G-G-G-G-UNIT
2006-07-27 15:31
pppppkkkkkk
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-7-26
收藏
得分:0 

哈哈,是个超市货品管理系统!昨晚通宵终于画好了!嘿嘿~~

2006-07-28 01:37
signjing
Rank: 1
等 级:新手上路
帖 子:47
专家分:0
注 册:2006-3-24
收藏
得分:0 
折磨人呀
这么多,看都头疼。
希望以后编程给点注释。

我的QQ:395812618
2006-08-18 14:35
快速回复:[求助]各位达人,能帮小弟画出这个程序的N\S流程图吗?万分感谢
数据加载中...
 
   



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

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