c语言 模块程序流程图,救命啊,这个程序的系统的主控模块流程图和主要模块流程图是什么?...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#include

#include

#include

struct node{

char data;

struct node *next;

};

struct node *createfromheada(float *a,char i);

struct node *createfromheadb(float *b,char j);

void fnDisplay( struct node *head );/*输出单链表head每个结点*/

void main( void )

{

struct node *head1,*head2;

float x1,x2,*a,*b;

char i,j;

a=&x1;b=&x2;

printf("The first number is '+' or '-':\nThe second number is '+' or '-':\n");

scanf("%c,%c",&i,&j);

printf("\nPlease input the first number x1(End by '$'):\n");

head1=createfromheada(a,i);

fnDisplay( head1 );

printf("\n");

printf("\nPlease input the second number x2(End by '$'):\n");

head2=createfromheadb(b,j);

fnDisplay( head2 );

printf("\n");

printf("\nx1+x2=%f\n",x1+x2);

printf("\nx1-x2=%f\n",x1-x2);

printf("\nx1*x2=%f\n",x1*x2);

printf("\nx1/x2=%f\n",x1/x2);

getch();

}

void fnDisplay( struct node *head )

{

struct node *p;

p = head;

while(p!=NULL){

printf("%c", p->data);

p = p->next;

}

}

struct node *createfromheada(float *a,char i)

{

struct node *head,*s;

char c;

int flag=1,d=1;

float N=0;

head=(struct node *)malloc(sizeof(struct node));

head->data=i;

head->next=NULL;

while(flag==1)

{

c=getchar();

if(c!='$')

{

if(c-'0'<=0)

continue;

s=(struct node *)malloc(sizeof(struct node));

s->data=c;

N=N*d+(c-'0');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值