somme de pile C
stack<int> si;
int sum = 0;
stack<int> tsi(si);
while (!tsi.empty()) {
sum += tsi.top();
tsi.pop();
}
Helpless Hawk
stack<int> si;
int sum = 0;
stack<int> tsi(si);
while (!tsi.empty()) {
sum += tsi.top();
tsi.pop();
}
pushrear
ArrayStack
stack ;
int sum = 0;
sumTopN(n);
while (!stack.isEmpty()) {
sum += stack.top();
stack.pop();
}
return sum;