As you start participating in coding competitions, you
are fully acknowledged with most of the errors which generally occurs during
the program. What to do if you’re facing an error that doesn’t usually occurs
i.e., a special type of error known as “Presentation Error”.
These errors may occurs due to the following factors:
1) If there
is wrong formatting from your side, the answer seems to be correct but the
online judge doesn’t identifies it.
2) If
an output results to an integer but you’re
presenting it in the form of string, then it may be a serious issue.
For e.g., the
program OUTPUT should be 15.76
ASSUME THAT WE HAVE THE
FOLLOWING JAVA CODE SNIPPET:
.
.
String
ans="15.76";
System.out.println(ans); //gives a presentation error
.
.
float
correct_form=Float.valueOf(ans);
System.out.printf("%.2f",correct_form);
// no
presentation error
Remember
the saying:
“Giving a CLUE is meaningless until it is definite.”
Hope this articles helps you a lot, but if the problem persists, then comment below for further solutions.
Thank You,
Tech Know
Comments
Post a Comment