0
Kaleidoscopes~Code Coach) 1 of the hidden test cases failed!! Please tell me what went wrong.
3 Antworten
+ 1
Could you add a link to the Code coach? Is this the one with the Hannukah candles?
+ 1
You are taking input a int value into double, if input is in double type, then use nextDouble()..
For double, format specifier is %lf.
And output statement is
System.out.printf("%.2lf",res);
format is in string class..
String.format("%.2lf",res);
0
I think the problem in java will be the output. I would prefer i.e.;
DecimalFormat fo = new DecimalFormat("#.##");
System.out.print(fo.format(res));