a346377452 于 2016.02.24 22:33 提问

#include
#include
typedef struct Node {
int number;
char name[20];
Node *next;
}Qnode;
typedef struct {
Qnode *front;
Qnode *rear;
int n;
scanf_s("%d", &n);
for (int i = 1;i <= n;i++) {
Qnode p;
scanf_s("%d %s", &p.number, p.name, 20);
if (q->front== q->rear) {
q->front = &p;
q->rear = q->front->next=NULL;

``````    }
else {
q->rear = &p;
q->rear = q->rear->next=NULL;
}
}
``````

}
//if (q->front == q->rear) printf("empty");
printf("%d %s\n", q->front->number, q->front->name);
q->front = q->front->next;
}
int main() {
q->front = q->rear = NULL;
q->front=q->rear= (Qnode*)malloc(sizeof(Qnode));
q->front->next = q->rear->next = NULL;
Enqueue(q);
Dequeue(q);

}

2个回答

caozhy      2016.02.24 22:46

Qnode p;

WinsenJiansbomber   2016.03.06 23:37

#include#include#define max 20typedef struct tnode{ char data;  struct tnode *lchild,*rchild;}BTNode;void createbtnode(BTNode *&bt,char *&str){ int k,j=0,top=-1;  char ch;  BTNode *p=NULL,*st[max];  b

#include&amp;lt;iostream&amp;gt;using namespace std;class CCourse{private: long no; float credit; static int total_course;public: CCourse(long n,float c) {no=n; credit=c; total_course++; } CCourse(const CCour...

public class VoConactor { private String conName; private int number; public String getconName(){  return conName; } public void setconName(String conName){  this.conName = conName; } public int getnu
C程序新手上路

Python求解错，不知道哪里有问题。。。
import randomsecert = random.randint(1,10)temp = input(&quot;不妨猜一下通哥心里想的是哪个数字：&quot;)guess = int(temp)while guess != secert: if guess == secert: pass else: if guess &amp;gt; secert: print(&quot;哎，大了大了~~~&quot;) else: ...

#include "stdafx.h" int main(int argc, char* argv[]) { int array[]={0,1,2,3,4,5,6,7,8,9}; int i=0; int j=0; for(i=0;i  j=0; for(j=0;j array[j]=0; } printf("这是第%d次循环",i); }    return