m0_62711176
2021-10-14 09:37
采纳率: 50%
浏览 14

停车场问题,车进入的那个函数jinru有问题

#includeusing namespace std;typedef struct{ string data[20][3]; int top;}SeqStack;typedef struct{ string data[40][3]; int rear, front;}SeQueue;SeqStack* s, * ss;SeQueue* q;SeqStack* Init_SeqStack(SeqStack* s){ s = (SeqStack*)malloc(sizeof(SeqStack)); s->top = -1; return s;}int Empty_SeqStack(SeqStack* s){ if (s->top == -1) return 1; else return 0;}int Push_SeqStack(SeqStack* s, string a[3]){ if (s->top == 19) return 0; else { s->top++; s->data[s->top][0]= a[0]; s->data[s->top][1] = a[1]; s->data[s->top][2] = a[2]; return 1; }}string* Pop_SeqStack(SeqStack* s){ string c[3]; c[0] = s->data[s->top][0]; c[1] = s->data[s->top][1]; c[2] = s->data[s->top][2]; s->top--; return c;}int jinru(SeqStack* s,SeQueue* q){ string message, id, time; string a[3],b[3]; cout << "please input message" << endl; cin >> message; cout << "please input id" << endl; cin >> id; cout << "please input time" << endl; cin >> time; a[0] = message; a[1] = id; a[2] = time; if (s->top == 19) { q->rear+


- 
- 


  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • qfl_sdu 2021-10-14 09:38
    已采纳

    代码没贴全,代码用代码段贴

    打赏 评论

相关推荐 更多相似问题