You are viewing a single comment's thread. Return to all comments →
using namespace std; int main() {
string input{}; cin >> input; stringstream ss(input); vector<int> nums{}; int n{}; char bin{}; int check{}; if (!((ss.peek() - 48 > -1 && ss.peek() - 48 < 10) || ss.peek() == 45)) { ss >> bin; } while ((ss.peek() - 48 > -1 && ss.peek() - 48 < 10) || ss.peek() == 45) { check = ss.peek() - 48; if((check > -1 && check < 10)|| check == -3){ ss >> n; nums.push_back(n); } ss >> bin; } for (int n : nums) { cout << n << '\n'; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
StringStream
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
include
include
using namespace std; int main() {
}