Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

sum of stack c++

 stack<int> si;
    int sum = 0;
    stack<int> tsi(si);
    while (!tsi.empty()) {
        sum += tsi.top();
        tsi.pop();
    }
 
PREVIOUS NEXT
Tagged: #sum #stack
ADD COMMENT
Topic
Name
4+2 =