티스토리 뷰

IS & Audit/Tool & Tips

Java Submissions

Auditoris 2010. 2. 16. 18:02

How to submit in Java (now 1.6)

Programming-Challenges.com


We have received several complains from people using this site about troubles submitting in Java. Please, use the following skeleton to make your submissions work.

/*
 * 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
                line [length++] += input;
            }

            if ((input < 0) && (length == 0)) return null;  // eof
            return new String(line, 0, length);
        }catch (IOException e){
            return null;
        }
    }

    public static void main(String args[])  // entry point from OS
    {
        Main myWork = new Main();  // Construct the bootloader
        myWork.run();            // execute
    }

    public void run() {
        new myStuff().run();
    }
}
class myStuff implements Runnable{
    public void run(){
        	// Your program here
        }
    
    // You can insert more classes here if you want.
}



2010.02.16.




'IS & Audit > Tool & Tips' 카테고리의 다른 글

정보시스템감리 영역별 평가의 기준  (0) 2010.04.25
보고서 쓰기와 다듬기  (1) 2010.01.13
프로세스 그룹과 지식영역  (0) 2009.04.29
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/03   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
글 보관함