首页 > 试题广场 >

void

[问答题]

void AE(Stack& S) {

InitStack(S);

Push(S,3);

Push(S,4);

int x=Pop(S)+2*Pop(S);

Push(S,x);

int i,a[5]={1,5,8,12,15};

for(i=0;i<5;i++) Push(S,2*a[i]);

while(!StackEmpty(S)) cout<<Pop(S)<<' ';

}

该算法被调用后得到的输出结果为?
该算法被调用后得到的输出结果为: 30  24  16  10  2  10
发表于 2017-09-21 15:37:32 回复(0)