We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 16: Exceptions - String to Integer
Day 16: Exceptions - String to Integer
Sort by
recency
|
983 Discussions
|
Please Login in order to post a comment
import Foundation
/* * Define an ErrorType */ enum StringToIntTypecastingError: Error { case BadString }
/* * Read the input */ let inputString = readLine()!
do { try print(stringToInt(inputString: inputString)) } catch StringToIntTypecastingError.BadString { print("Bad String") }
**// I am getting Error reading result file.You should use exception handling concepts.
but output printing correct can any one please help in this in Swift language **
public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
}
Where is the d*mn error here:
For Python3 Remove "if name =='main'; before implementing
Python is not checkable i think. Some file read error. Is this code OK?