当前位置: 首页 > wzjs >正文

网站核查怎么抽查广州做啊里巴巴网站多少钱

网站核查怎么抽查,广州做啊里巴巴网站多少钱,英文外链seo兼职,网站举报电话是多少有些函数需要提前准备 typedef struct node{int data;struct node* next; }node; typedef struct{int size;node* top; }toplist;//进栈函数,传入第一个参数为记录栈顶的结构体指针,第二个参数为要进去的节点指针 bool push(toplist* managelist,node* …

有些函数需要提前准备

typedef struct node{int data;struct node* next;
}node;
typedef struct{int size;node* top;
}toplist;//进栈函数,传入第一个参数为记录栈顶的结构体指针,第二个参数为要进去的节点指针
bool push(toplist* managelist,node* new);//出栈函数,传入第一个参数为记录栈顶的结构体指针,第二个参数出栈节点的记录的数,用指针记录
bool pop(toplist* managelist,int* num);//插入节点且将num赋值给该节点的数值
node* iniList(int num);//记录栈顶结构体函数初始化,size = 0,top->NULL
toplist *managelist_init(void);

栈在单向链表中,并实现十进制转为二进制的操作

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>typedef struct node{int data;struct node* next;
}node;
typedef struct{int size;node* top;
}toplist;bool push(toplist* managelist,node* new);
bool pop(toplist* managelist,int* num);
node* iniList(int num);
toplist *managelist_init(void);int main(void)
{int data = -1;toplist* managelist = managelist_init();
//此为测试代码,可以删除或者忽略
/*push(managelist,iniList(1));printf("%p\n",managelist->top);push(managelist,iniList(2));printf("%p\n",managelist->top);push(managelist,iniList(3));printf("%p\n",managelist->top);push(managelist,iniList(4));printf("%p\n",managelist->top);printf("%d \t %d \t %p\n",data,managelist->size,managelist->top);printf("before pop!\n");pop(managelist,&data);printf("%d \t %d \t %p\n",data,managelist->size,managelist->top);
*///无符号类型,方便转化负数的二进制unsigned int number = -1;while(1){printf("enter a decimal number:");scanf("%d",&number);if(number == 0){push(managelist,iniList(number)); }else{while(number != 0){push(managelist,iniList(number%2));number = number/2;}}while(managelist->size != 0){pop(managelist,&data);printf("%d",data);}printf("\n");}return 0;
}bool push(toplist* managelist,node* new)
{new->next = managelist->top;managelist->top = new;managelist->size++;return true;
}bool pop(toplist* managelist,int* num)
{if(managelist->top == NULL || managelist->size == 0){return false;   }node* tmp = managelist->top;*num = managelist->top->data;managelist->top = managelist->top->next;managelist->size--;free(tmp);return true;}node* iniList(int num)
{node* p = (node*)malloc(sizeof(node));if(p == NULL){printf("allot space is failure!\n");return NULL;}p->data = num;p->next = NULL;return p;}toplist *managelist_init(void)
{toplist* p = (toplist*)malloc(sizeof(toplist));if(p == NULL){printf("allot space is failure!\n");}p->size = 0;p->top = NULL;return p;
}

栈在数组中实现

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#define HIGH 6int stack_arr[HIGH] = {0};
int flag = -1;bool push(int stack_arr[],int num);
bool pop(int stack_arr[],int* num);int main(void)
{int num = -1;push(stack_arr,1);push(stack_arr,2);push(stack_arr,4);push(stack_arr,3);pop(stack_arr,&num);printf("%d \t %d\n",num,flag);return 0;
}bool push(int stack_arr[],int num)
{if(flag == HIGH-1){return false;}stack_arr[++flag] = num;return true; }
bool pop(int stack_arr[],int* num)
{if(flag == -1){return false;}*num = stack_arr[flag--];return true;}

十进制转二进制函数、十进制转八进制函数:

void dec_to_bin(toplist* managelist,unsigned int number)
{int data = -1;if(number == 0){push(managelist,iniList(number)); }else{while(number != 0){push(managelist,iniList(number%2));number = number/2;}}while(managelist->size != 0){pop(managelist,&data);printf("%d",data);}printf("\n");
}void dec_to_oct(toplist* managelist,unsigned int number)
{int data = -1;if(number == 0){push(managelist,iniList(number)); }else{while(number != 0){push(managelist,iniList(number%8));number = number/8;}}while(managelist->size != 0){pop(managelist,&data);printf("%d",data);}printf("\n");
}

直接使用

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>typedef struct node{int data;struct node* next;
}node;
typedef struct{int size;node* top;
}toplist;bool push(toplist* managelist,node* new);
bool pop(toplist* managelist,int* num);
node* iniList(int num);
toplist *managelist_init(void);void dec_to_bin(toplist* managelist,unsigned int number);
void dec_to_oct(toplist* managelist,unsigned int number);int main(void)
{int data = -1;toplist* managelist = managelist_init();unsigned int number = -1;while(1){printf("enter a decimal number:");scanf("%d",&number);dec_to_bin(managelist,number);dec_to_oct(managelist,number);}return 0;
}bool push(toplist* managelist,node* new)
{new->next = managelist->top;managelist->top = new;managelist->size++;return true;
}bool pop(toplist* managelist,int* num)
{if(managelist->top == NULL || managelist->size == 0){return false;   }node* tmp = managelist->top;*num = managelist->top->data;managelist->top = managelist->top->next;managelist->size--;free(tmp);return true;}node* iniList(int num)
{node* p = (node*)malloc(sizeof(node));if(p == NULL){printf("allot space is failure!\n");return NULL;}p->data = num;p->next = NULL;return p;}toplist *managelist_init(void)
{toplist* p = (toplist*)malloc(sizeof(toplist));if(p == NULL){printf("allot space is failure!\n");}p->size = 0;p->top = NULL;return p;
}void dec_to_bin(toplist* managelist,unsigned int number)
{int data = -1;if(number == 0){push(managelist,iniList(number)); }else{while(number != 0){push(managelist,iniList(number%2));number = number/2;}}while(managelist->size != 0){pop(managelist,&data);printf("%d",data);}printf("\n");
}void dec_to_oct(toplist* managelist,unsigned int number)
{int data = -1;if(number == 0){push(managelist,iniList(number)); }else{while(number != 0){push(managelist,iniList(number%8));number = number/8;}}while(managelist->size != 0){pop(managelist,&data);printf("%d",data);}printf("\n");
}

http://www.dtcms.com/wzjs/544550.html

相关文章:

  • 怎么在四川建设厅网站上进行劳务合同备案用pycharm做网站
  • 禁止同ip网站查询淄博网站备案
  • 网站访客qq获取系统 报价推广公司简介
  • 科凡网站建设在社保网站上怎么做员工的退费
  • 华升建设集团公司网站自动生成海报的网站
  • 设计互动网站建设什邡市建设局门户网站
  • 豆瓣网站是怎么建设的十大网络平台
  • 贵州企业网站建设公司建设银行注册网站首页
  • 滨州网站建设模板建设医院网站备案
  • 做兼职那个网站比较好社交网站开发公司
  • 营销型网站模板住建网站需多少钱
  • 做川菜的网站wordpress页面难看
  • 招聘网站怎么做线下活动wordpress apache ssl
  • 大气公司网站源码 企业网页模板建站 制作asp程序后台 中英文代码科技公司内蒙古网站制作
  • 建设一个网站报价小学教学活动设计方案模板
  • 杭州滨江区建设局网站盗图来做网站
  • 厦门建设局网站商品房注册会计师报名时间
  • 网站下载免费做网站登录的需求分析
  • 我想开个网站成都网上商城网站建设
  • 甘肃省建设厅注册中心网站12355能找回智慧团建密码吗
  • 如何通过网站开发客户ag娱乐建设网站
  • 网站建设方案书一定要交国内响应式网站欣赏
  • 网站建设合同的风险责任桥梁建设网站
  • 做网站要什么步骤建设银行网站图片
  • 北京ifc大厦商城类网站怎么优化
  • 赣州热门网站wordpress右下角添加欢迎弹窗
  • 建设网站哪些公司好wordpress 模板丢失.
  • 优秀的设计网站有哪些罗湖网页设计
  • 举报网站建设公司怎么自建一个网站
  • 杭州网站维护公司网站开发实例教程