You are viewing a single comment's thread. Return to all comments →
I tried this code but unable to cross 5th testcase which contain large negative numbers.Can anybody explain me for this?
#include <sstream> #include <vector> #include <iostream> using namespace std; int main() { string str; cin >> str; vector<int> integers; stringstream ss(str); int a; char ch; while(1) { ss>>a>>ch; if(!a) break; integers.push_back(a); a=0; } for(int i = 0; i < integers.size(); i++) { cout << integers[i] << "\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 →
I tried this code but unable to cross 5th testcase which contain large negative numbers.Can anybody explain me for this?