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

為了賬號安全,請及時綁定郵箱和手機立即綁定

(和這個課程不相關(guān),不知道該去哪里求教了)這個代碼哪里錯了,我在vs2013 怎么運行不出來 ,求大神 ?。。?!

#include<stdio.h>

#include<stdlib.h>

#define LIST_INIT_SIZE 100

#define LISTINCRAMENT 10

#define INFEASIBLE -1

#define OK 1

#define OVERFLOW -2

#define ERROR 0

#define FALSE 0

#define TRUE 1

typedef int Status;

#define STACK_INIT_SIZE 100

#define STACKINCREMENT 10

#define SElemType char

typedef struct{

SElemType *base;

SElemType *top;

int stacksize;

}SqStack;

Status InitStack(SqStack &S){

S.base = (SElemType*)malloc(STACK_INIT_SIZE*sizeof(SElemType));

if (!S.base) exit(OVERFLOW);

S.top = S.base;

S.stacksize = STACK_INIT_SIZE;

return OK;

}

Status GetTop(SqStack &S, SElemType &e){

if (S.top == S.base) return ERROR;

e = *(S.top - 1);

return OK;

}

Status Push(SqStack &S, SElemType e){

if (S.top - S.base >= S.stacksize){

S.base = (SElemType*)realloc(S.base, (S.stacksize + STACKINCREMENT)*sizeof(SElemType));

if (!S.base)exit(OVERFLOW);

S.top = S.base;

S.stacksize += STACKINCREMENT;

}

*S.top++ = e;

return OK;

}

Status Pop(SqStack &S, SElemType &e){

if (S.top == S.base) return ERROR;

e = *S.top--;

return OK;

}

Status StackEmpty(SqStack &S){

if (S.top == S.base)

return TRUE;

else

return FALSE;

}


int main(){

SqStack S, H;

char e;

int i, n;

char t[80];

InitStack(S);

InitStack(H);

printf("請輸入車廂長度:");

scanf_s("%d", &n);

if (n > 80) exit(OVERFLOW);

printf("請輸入硬席(H)和軟席車廂(S)序列:");

for (i = 0;i < n; ++i){

scanf_s("%c", &t[i]);

}

for (i = 0; i < n; i++){

if (t[i] == 'H')

Push(H,t[i]);

else?

Push(S,t[i]);

}

while (!StackEmpty(S)){

Pop(S, e);

printf("%c", e);

}

while (!StackEmpty(H)){

Pop(H, e);

printf("%c", e);

}

return 0;

}


正在回答

1 回答

報錯信息發(fā)出來看看?

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

去南極給企鵝洗熱水澡 提問者

他沒有報錯 ,就是輸出是不正確的,應(yīng)該輸出的是排列好的“SSSHHH”這種形式呀,可是那里輸出的是漢字==
2015-10-23 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

(和這個課程不相關(guān),不知道該去哪里求教了)這個代碼哪里錯了,我在vs2013 怎么運行不出來 ,求大神 !?。?!

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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