1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream> #include<sstream> using namespace std; int main() { stringstream stream("-1"); unsigned int x=0; stream>>x; if(stream) cout<<x; else cout<<"error"; return 0; }
1
error