以下程序的执行结果是 #include < lostream >#include < stack >using nanespace std;void main( ){ stack< int> s; s. push(1); s. push(2); s. push(3); s. push(4); cout << "s.size:" < s.size() << ",s:"; while (!s. eapty()) { coutA: s. size; 3, s: 123
B: s. size: 3, s: 432
C: s. size: 4, s; 1234
D: s. size: 4, s: 4321
B: s. size: 3, s: 432
C: s. size: 4, s; 1234
D: s. size: 4, s: 4321
举一反三
- What day was it yesterday A: It’s Sam’s. B: It’s Mike’s. C: It’s mine.
- What were the millionaires average scores in college A: A’s and B’s. B: B’s and C’s. C: C’s and D’s. D: Not mentioned.
- There is ______ ID in the bag. It’s ______ Jill’s.
- Henry’s baggage is ______ as Rachel’s.
- 写出下列程序段的输出结果(栈的元素类型为char)。 void main(){ Stack S; char x,y; InitStack(S); x= ‘c’; y= ‘k’; Push(S,x); Push(S, ‘a’); Push(S,y); Pop(S,x); Push(S, ‘t’); Push(S,x); Pop(S,x); Push(S, ‘s’); while(!StackEmpty(S)) { Pop(S,y); printf(y); } printf(x); }