1 2 3 4 5 6 7 8 9 10 11 | #include <string> #include <sstream> #include <iostream> int main() { std::string str="123"; std::istringstream buf(str.substr(1,2)); long int num; buf >> num; std::cout << num << '\n'; } |
-
upload with new input
-
result: Success time: 0s memory: 2984 kB returned value: 0
12
23
-
result: Success time: 0s memory: 2984 kB returned value: 0
23
-
result: Success time: 0.02s memory: 2816 kB returned value: 0
245
23
-
result: Success time: 0.01s memory: 2860 kB returned value: 0
333
23
-
result: Success time: 0.01s memory: 2816 kB returned value: 0
#include <string> #include <sstream> #include <iostream> int main() { std::string str="00023"; std::istringstream buf(str.substr(1,2)); long int num; buf >> num; std::cout << num << '\n'; }23
-
result: Success time: 0.01s memory: 2816 kB returned value: 0
#include <string> #include <sstream> #include <iostream> int main() { std::string str="123"; std::istringstream buf(str.substr(0,2)); long int num; buf >> num; std::cout << num << '\n'; }23
-
result: Success time: 0.01s memory: 2860 kB returned value: 0
23


