第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

怎么回事呢?

怎么回事呢?

C
慕標(biāo)7193633 2018-05-06 11:30:53
#include<stdio.h> #include<malloc.h> #define MAXLEN 10; typedef struct{ int data[MAXLEN]; int front; int count; }Node; //构造空队列 void InitQueue(Node*q){ q=(Node*)malloc(sizeof(Node)); q->front=1; q->count=0; } //判断对列是否为空 int Emptyq(Node*q){ if(q->count==0){ return 1; }else{ return 0; } } //打印对列 void PrintQueue(Node*q){ int i; for(i=0;i<q->count;i++){ printf("%d ",q->data[i]); } } //入队操作 int EnQueue(Node*q,int x){ int p; if(q->count==MAXLEN){ printf("对列溢出"); return 0; }else{ p=(q->front+q->count)%MAXLEN; q->data[p]=x; (q->count)++; return 1; } } //出队操作 int OutQueue(Node*q,int*x){ if Emptyq(q){ printf("对列为空!"); return 0; }else{ *x=q->data[q->count]; q->front=(q->front+1)%MAXLEN; q->count++; return 1; } } int main(){ int a; int*y; //取对列头元素 Node*q; InitQueue(q); char ch='!'; printf("输入待入队的元素,输入?表示结束:\n"); while(ch!='?'){ scanf("%d",&a); EnQueue(q,a); //入队 ch=getchar(); }     PrintQueue(q); //打印数组 OutQueue(q,y); //出队 printf("对列头元素为%d",*y); return 0; }
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關(guān)注
  • 863 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號