-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreak.cpp
More file actions
35 lines (34 loc) · 792 Bytes
/
break.cpp
File metadata and controls
35 lines (34 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<<<<<<< HEAD
#include <string>
using std::string;
using std::stoi;
=======
#include <stack>
using std::stack;
>>>>>>> 956f5442b64d5f8b716e7e08975df525510cf397
#include <iostream>
using std::cout;
using std::endl;
int main(){
<<<<<<< HEAD
int total=0;
string number;
string stringOfInt = "100,5,6,234,6457,1,2345,876,5234,5,57,5,325,455,6";
for(auto i : stringOfInt){
if(i == ','){
total += stoi(number);
number = std::string();
}
else{
number += i;
}
=======
int total = 0;
stack<int> stackOfInt = {100,5,6,234,6457,1,2345,876,5234,5,57,5,325,455,6};
for(auto i : stackOfInt){
total += i;
>>>>>>> 956f5442b64d5f8b716e7e08975df525510cf397
}
cout << total << endl;
return 0;
}