[solved] NZEC in HS08TEST

Hello,
I am getting NZEC for the solution I submitted for https://www.codechef.com/problems/HS08TEST

My solution:
https://www.codechef.com/viewsolution/18602441

I tried using try catch and got WA
https://www.codechef.com/viewsolution/18602470

This means that some line of my code throws exception but I am not sure which line actually throws it. Need help !

Input format is like this
Input:
30 120.00
When you use in.readLine() it reads the whole line from input “30 120.00” , so when you use Integer.parseInt it throws an exception as the argument is not an integer. You need to separate the two numbers.
Use something like
String s[]=in.readLine().split(" ");
int withdraw = Integer.parseInt(s[0]);
double balance = Double.parseDouble(s[1]);

Thanks @vbt_95 for helping me out. Your solution worked.

https://www.codechef.com/viewsolution/18604910

Good wishes from India! :slight_smile:

1 Like

No problem. Good wishes from India too :slight_smile: