34x26写出未来的每一步一脚印的含义

能否将下面每一步c语言步骤的含义解释下,尤其是指针部分,没有看懂她的意思_百度知道
能否将下面每一步c语言步骤的含义解释下,尤其是指针部分,没有看懂她的意思
#include&stdio.h& #include&stdlib.h& #include&string.h& #define LENGTH 6 #define MAX 20 #define S(r) (r-8)/2 #define NULL 0 struct node{
char data[10]; struct node * }; struct node * struct cell{ int CN struct node * struct node * struct node * }TimeQueue[LENGTH]; void Inquir() {
char Infor[10]; struct node *R (第一个功能:查询)printf(&Please input the time you want to search!(24 hours 8~20 o'clock,include 8o'clock)\n&); scanf(&%d&,&n) ;if(n&=8&&n&20){ n=S(n); printf(&Please input your No.!\n&); scanf(&%s&,Infor); Rem=TimeQueue[n]. for(;Rem-&next!=NULL;Rem=Rem-&next) if(strcmp(Rem-&data,Infor)==0) if(Rem-&locat!=0) (输出机位信息)printf(&The computer number is %d\n&,R缉常光端叱得癸全含户em-&locat); else printf(&Sorry,you are still in the queue or you haven't booked!&); } else printf(&Error!Please input again.\n&); } void inquir() {
printf(&Please input the time you want to search!(24 hours 8~20o'clock,include 8 o'clock)\n&); scanf(&%d&,&n); if(n&=8&&n&20){ n=S(n); if(TimeQueue[n].CNum&MAX) printf(&There are %d empty computer!\n&,MAX-TimeQueue[n].CNum); else printf(&Sorry,there is no empty computer!\n&); } else printf(&Error!Please input again.\n&); } void booking() {
char Infor[10]; struct node *R struct node *p; printf(&Please input the time you want to book!\n&); scanf(&%d&,&n); if(n&=8&&n&20){ n=S(n); if(TimeQueue[n].CNum&MAX){ printf(&Please input your No.!\n&); scanf(&%s&,Infor); if(TimeQueue[n].first==NULL){ Rem=(struct node *)malloc(sizeof(struct node)); Rem-&locat=1; strcpy(Rem-&data,Infor); Rem-&next=NULL; TimeQueue[n].first=R TimeQueue[n].last=R TimeQueue[n].CNum++; printf(&Succeed to book!\n&); } else{ Rem=(struct node *)malloc(sizeof(struct node)); strcpy(Rem-&data,Infor); Rem-&next=NULL; p=TimeQueue[n]. Rem-&locat=TimeQueue[n].CNum+1; printf(&%d&,Rem-&locat); TimeQueue[n].last=R p-&next=R TimeQueue[n].CNum++; printf(&Succeed to book!\n&); } } else printf(&There in no empty computer!&); } else printf(&Error!Please input again.\n&); } 更详细的程序我可以发到你们邮箱里,这是我的邮箱
提问者采纳
#include&stdio.h& #include&stdlib.h& #include&string.h& #define LENGTH 6 /*最大时间点*/#define MAX 20/*时间队列最大结点个数*/#define S(r) (r-8)/2 /*将24小时制的小时数转换为以0起始并小于LENGTH的数*/#define NULL 0 struct node{ /*机位信息*/char data[10];/*存储No.*/struct node */*指向下一个node元素*/}; struct node * struct cell{ int CN/*时间队列中元素个数*/struct node */*指向第一个node元素*/struct node */*指向中间node元素*/struct node */*指向最后一个node元素*/}TimeQueue[LENGTH]; /*已预约时间队列*/ /*根据时间、No.,查询预约情况*/void Inquir() {
char Infor[10]; /*No.*/struct node *R /*声明一个node指针*/(第一个功能:查询)printf(&Please input the time you want to search!(24 hours 8~20 o'clock,include 8o'clock)\n&); scanf(&%d&,&n) ;/*n:24小时制中[8,20)的小时数*/if(n&=8&&n&20){ n=S(n);/*将24小时制的小时数转换为以0起始并小于LENGTH的数*/printf(&Please input your No.!\n&); scanf(&%s&,Infor); Rem=TimeQueue[n].
/*用Rem记录当前时间点(n)下时间队列的头结点*/for(;Rem-&next!=NULL;Rem=Rem-&next) /*遍历时间队列*/if(strcmp(Rem-&data,Infor)==0) /*找到该身份No.*/if(Rem-&locat!=0) /*机位信息存在?*/(输出机位信息)printf(&The computer number is %d\n&,Rem-&locat); else printf(&Sorry,you are still in the queue or you haven't booked!&); } else printf(&Error!Please input again.\n&); } /*查询空闲电脑数*/void inquir() {
printf(&Please input the time you want to search!(24 hours 8~20o'clock,include 8 o'clock)\n&); scanf(&%d&,&n); /*n:24小时制中[8,20)的小时数*/if(n&=8&&n&20){ n=S(n); /*将小时数转换为以0起始的数*/if(TimeQueue[n].CNum&MAX) /*当前时间点(n)下时间队列不满的情况下*/printf(&There are %d empty computer!\n&,MAX-TimeQueue[n].CNum); /*输出空闲的数量*/else printf(&q缉常光端叱得癸全含户Sorry,there is no empty computer!\n&); } else printf(&Error!Please input again.\n&); } /*预约*/void booking() {
char Infor[10]; struct node *R struct node *p; printf(&Please input the time you want to book!\n&); scanf(&%d&,&n); if(n&=8&&n&20){ n=S(n); /*将小时数转换为以0起始的数*/if(TimeQueue[n].CNum&MAX){ /*当前时间点(n)下时间队列不满的情况下*/printf(&Please input your No.!\n&); scanf(&%s&,Infor); /*输入No.*/if(TimeQueue[n].first==NULL){ /*时间队列头结点为空时,插入的node为头结点*/Rem=(struct node *)malloc(sizeof(struct node)); /*为结点Rem申请一个struct node的空间大小来存放信息*/Rem-&locat=1;/*机位编号为1*/strcpy(Rem-&data,Infor);/*拷贝No.到结点Rem中*/Rem-&next=NULL;/*将Rem的下一结点置为NULL(标准做法)*/TimeQueue[n].first=R /*将时间队列记录头结点的指针指向Rem*/TimeQueue[n].last=R/*因为Rem为头结点,所以同时也是尾结点,将尾结点同样指向Rem*/TimeQueue[n].CNum++;/*时间队列结点个数增加1个*/printf(&Succeed to book!\n&); } else{ /*已存在头结点,则新结点插入到头结点以后*/Rem=(struct node *)malloc(sizeof(struct node));strcpy(Rem-&data,Infor); Rem-&next=NULL; p=TimeQueue[n]. /*用p指向当前时间队列的尾结点*/Rem-&locat=TimeQueue[n].CNum+1;
/*机位编号增加1*/printf(&%d&,Rem-&locat);/*输出机位编号*/TimeQueue[n].last=R/*将Rem赋值给新的尾结点*/p-&next=R/*将以前的尾结点的下一个结点置为新尾结点*/TimeQueue[n].CNum++;/*时间队列结点个数增加1个*/printf(&Succeed to book!\n&); } } else printf(&There in no empty computer!&); } else printf(&Error!Please input again.\n&); }
还有一部分的程序因为字数限制打不出来,能不能发到你的邮箱里,帮我看下剩下的程序?
可以哈!我邮箱联系你~——。-
提问者评价
按照你说的,真的成功了,好开心,谢谢你!
其他类似问题
按默认排序
其他1条回答
//太长了,贴不出来啊!腾讯#include&stdio.h&
//头文件,标准输入输出#include&stdlib.h&//头文件,标准库函数#include&string.h&//头文件,字符串#define LENGTH 6//宏定义,长度#define MAX 20//宏定义最大值#define S(r) (r-8)/2//宏定义S(r)#define NULL 0//宏定义 NULL为0struct node{//结构体,节点,单向链表//数据区,char data[10];//数据区struct node *//指针区,指向下一个节点}; struct node *
//链表的头结点struct cell{//结构体cellint CN//数据区,记录节点的数量struct node *//单向链表的第一个节点struct node *//单向链表的中间的节点struct node *//单向链表的最后一个节点}TimeQueue[LENGTH];//结构体数组,长度为6,即有6个元素void Inquir()//函数{
char Infor[10]; struc缉常光端叱得癸全含户t node *R //(第一个功能:查询)printf(&Please input the time you want to search!(24 hours 8~20 o'clock,include 8o'clock)\n&); //输入查询时间scanf(&%d&,&n) ;if(n&=8&&n&20){//如果时间合法n=S(n);//宏定义有S(n)printf(&Please input your No.!\n&); //请输入你的Noscanf(&%s&,Infor);Rem=TimeQueue[n].//Rem赋初值,指向单向链表的第一个节点for(;Rem-&next!=NULL;Rem=Rem-&next)//for循环,Rem依次向下移动,直到最后一个节点if(strcmp(Rem-&data,Infor)==0) //如果Rem所在的节点的数据区,即 data和用户输入的Infor一致,则终止循环if(Rem-&locat!=0)//如果Rem所在的节点的数据locat不为0,则输出下列信息//(输出机位信息)printf(&The computer number is %d\n&,Rem-&locat);
//输出电脑的编码是
Rem-&locatelse printf(&Sorry,you are still in the queue or you haven't booked!&);
//查询失败,提示错误信息} else printf(&Error!Please input again.\n&);
//如果输入的时间不合法,提示错误信息,用户重新输入}
c语言的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁有1,2,3,5,10,20六种砝码,输入它们的个数,输出它们共能够组成多少种不同的千克数请注明每一步代表什么含义,_百度作业帮
有1,2,3,5,10,20六种砝码,输入它们的个数,输出它们共能够组成多少种不同的千克数请注明每一步代表什么含义,
请注明每一步代表什么含义,
排列组合就行啦,即输入一个是从6个里面选择一个,C6 1=6 输入2个是 ;;C6 3=20 ;C6 4=15 输入5个是 C6 5=6 输入六个是 C6 6=1 上面这是每一个数字对应的输出数值.而要求总数时.由于1 2 3 1+3=4 5 1+5=6 2+5=7 3+5=8 1+3+5=9 10 20 因此可组成由1到41的各个数字 即可组成41个数值.说一说每一步表示的含义.波波看一本书,2天看了50页,照这样计算,10天能看多少页?1,50÷2表示(
)2,45×(12÷3)表示(
)3,50÷2×10表示(
)4,10÷2表示(
)_百度作业帮
说一说每一步表示的含义.波波看一本书,2天看了50页,照这样计算,10天能看多少页?1,50÷2表示(
)2,45×(12÷3)表示(
)3,50÷2×10表示(
)4,10÷2表示(
波波看一本书,2天看了50页,照这样计算,10天能看多少页?1,50÷2表示(
)2,45×(12÷3)表示(
)3,50÷2×10表示(
)4,10÷2表示(
)快哪,很急的说,哥哥姐姐们,帮帮忙吧。%>_
波波看一本书,2天看了50页,照这样计算,10天能看多少页?1,50÷2表示(平均每天能看多少页)2,45×(12÷3)表示( 实在是和本题无关)这个数据对吗?是不是50×(10÷2)那就表示先计算10天里面包含几个2天,每2天能看50页,再计算10天能看多少页3,50÷2×10表示(10天能看多少页)4,10÷2表示( 10天里面包含几个2天 )
1.50/2表示每天看多少页3.50/2*10表示10天能看多少页4.10/2表示10天中有多少个2天
1,每天看的页数。2,假如每3天看45页,12天看多少页。3,10天看的总页数。4,能看多少个的50页。
1,50÷2表示(这两天波波平均每天看了多少页)2,45×(12÷3)表示(假如3天看45页,照这样的速度12天能看多少页)3,50÷2×10表示( 照2天看了50页这样的的速度10天能看多少页)4,10÷2表示(假如50页为一节,10天看完,该书有多少节 )
波波看一本书,2天看了50页,照这样计算,10天能看多少页?1,50÷2表示( 每天能看多少页
)2,45×(12÷3)表示( 实在是和本题无关
)这个数据对吗?是不是50×(10÷2)那就表示先计算10天里面包含几个2天,每2天能看50页,再计算10天能看多少页3,50÷2×10表示( 先算出每天看多少页,...
1,50÷2表示(每天看的页数)2,45×(12÷3)表示(
)3,50÷2×10表示(10天看的页数
)4,10÷2表示(
您可能关注的推广请大神解释一下这道题的含义!希望可以分步解说每一步的含义,不胜感激_百度知道
请大神解释一下这道题的含义!希望可以分步解说每一步的含义,不胜感激
//f://f.jpg" esrc="http.baidu./zhidao/wh%3D600%2C800/sign=a20aa062b41a/79f0f736afc3fe8c4be://f.baidu.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="/zhidao/pic/item/79f0f736afc3fe8c4be;<a href="/zhidao/wh%3D450%2C600/sign=dcb3be7b9beafe4efbf736afc3fe8c4be&nbsp.hiphotos
s = s + a[i]*j;s=%d&#92,i = 1;最开始i为0.while(i&lt; i = 0;n表示换行符,那么s = 0 + a[0]*1;&#47,即s = 1+2*10; j = j*10,j。printf(&quot,s = 0, 即s = 21,s),j变为10,j为1,s初始化为0,第二个为十位数,按顺序放了3个数字1,i = 2,并且光标移动到这一行的下面那行的最前面;&#47;%d表示整数,j暂时没初始化,直到i&gt;j = 1;=2){} /&#47,即s = 21+300 = 321;printf为打印函数;=2则继续执行循环体内的语句;/,i; 那么第二次循环就是s = 1 + a[1]*10 (因为s第一次循环变为1了),可以在打印太打印括号中“”号中的内容. 其实这个程序就是将这个数组变为一个整数,&#92,s为0;/定义了3个int变量; i=i+1,3i;那么这个语句的结果是打印下面一行,第三个为百位数; s = 21 + a[2]*100,即s = 0 + 1*1 ;/ &#47;那么s=1; /2;定义了一个数组. 如果i&分别将j和i初始化为1和0;后面j变为100,2;n& /&#47,第一个元素为个位数;循环执行后面大括号中的语句,2;然后执行后面2句,3} &#47int a[3] = {1
其他类似问题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁六年级题目:请解释原理,说明每一步算是的含义。_百度知道
六年级题目:请解释原理,说明每一步算是的含义。
列火车以同样的速度驶过两座大桥?请重点说明怎样理解,用了47&#47,这列火车每分钟行驶多少米;15分钟?这列火车的车身长多少米,第一座桥长1270m,用了11&#47,第二座桥长1360m;60分钟
火车每分钟行驶的速度90÷1/20=1800米3
在经过大桥的时间里火车行驶了多少米; 在一定的时间了火车行走的距离减去大桥的距离等于火车的长度1 在一定 距离里行驶需要用多少时间。=1320米
或者=1410米4 ,=90米
11/15-47/60=1/20分钟
2 距离除以时间等于
其他类似问题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 在漫长路的每一步 的文章

 

随机推荐