Hackerrank | 30 days of code | Day 16-Solution in c++| Exceptions-String-to-Integer-hackerrank-Solution-in-c++


Hackerrank | 30 days of code | Day 16-Solution in c++| Exceptions-String-to-Integer-hackerrank-Solution-in-c++

Hackerrank Solution 30-days-of-code

https://www.hackerrank.com/challenges/30-exceptions-string-to-integer/problem
Day 16 Exceptions - String to Integer Solution in Cpp
#include <iostream> using namespace std; int main(){ int64_t n; string S; cin >> S; try { n = stoi(S); cout << n; } catch (...) { cout < "Bad String"; } return 0; }

Post a Comment

0 Comments