As I need to break my dead brain recently, I make a goal to solve the problems of Programming Challenges site. When you enter the site, you can see various types of problems we can solve by programming languages (e.g., c or java). In case of JAVA, there were lots of complaints from users, he(?) made a skeleton.
My coding is not perfect. (First time, I could not understand the problem exactly due to my poor English skills. :()
/*
* Main.java
* java program model for www.programming-challenges.com
*/
import java.io.*;
import java.util.*;
class Main implements Runnable{
static String ReadLn(int maxLength){ // utility function to read from stdin,
// Provided by Programming-challenges, edit for style only
byte line[] = new byte [maxLength];
int length = 0;
int input = -1;
try{
while (length < maxLength){//Read untill maxlength
input = System.in.read();
if ((input < 0) || (input == '\n')) break; //or untill end of line ninput