Java Stdin and Stdout II

  • + 0 comments

    This was my original solution:

    public class Solution {
    
        public static void main(String[] args) {
            try{
                Scanner scan = new Scanner(System.in);
                int i = scan.nextInt();
                double d =scan.nextDouble();
                scan.useDelimiter("\n");
                String s = scan.next();
                scan.close();
    
                System.out.println("String: " + s);
                System.out.println("Double: " + d);
                System.out.println("Int: " + i);            
            }catch(Error e){
                System.out.println("something went wrong:" +e);
            }
    
        }
    }
    

    I'm not really sure why this doesnt satisfy the test cases, although it prints as expected