Created
July 7, 2016 08:06
-
-
Save sifue/a6ff0ae1d112a2dd37423ca7b2ea374e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <sstream> | |
| using namespace std; | |
| vector<string> split(const string &s, char delim) { | |
| vector<string> elems; | |
| stringstream ss(s); | |
| string item; | |
| while (getline(ss, item, delim)) { | |
| if (!item.empty()) { | |
| elems.push_back(item); | |
| } | |
| } | |
| return elems; | |
| } | |
| int main() { | |
| string str; | |
| getline(cin, str); | |
| vector<string> splited = split(str, ' '); | |
| int desk = stoi(splited[0].c_str()); | |
| int chair = stoi(splited[1].c_str()); | |
| cout << desk * chair << endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment