Submission #141041


Source Code Expand

import java.util.*;
 
public class Main{
	public static void main(String[] args){
		new Main().run();
	}
 
	void run()
	{
		//標準入力にはScannerを使います
		Scanner cin = new Scanner(System.in);
		
		//標準入力から、整数nを受け取ります。
		int n = cin.nextInt();
		
		//答えを入れておく変数を作ります。
		String ret = "";
		
		if(n < 100) ret = "00";
		else if (100 <= n && n <= 5000) {
			n = (n * 10) / 1000;
			ret = new String(n);
			if (ret.length() < 2) ret = "0"+ret;
		} else if (6000 <= n && n <= 30000){
			n = (n + 50) / 1000;
			ret = new String(n);
		} else if (35000<=n && n <= 70000){
			n = ((n - 30)/5 + 80) / 1000;
			ret = new String(n);
		} else if (n <= 70000){
			ret = "89";
		}
		
		//答えを出力します。
		System.out.println(ret);
	}
}

Submission Info

Submission Time
Task B - 視程の通報
User teraijun
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 849 Byte
Status CE

Compile Error

./Main.java:22: error: no suitable constructor found for String(int)
			ret = new String(n);
			      ^
    constructor String.String(int,int,char[]) is not applicable
      (actual and formal argument lists differ in length)
    constructor String.String(char[],boolean) is not applicable
      (actual and formal argument lists differ in length)
    constructor String.String(StringBuilder) is not applicable
      (actual argument int cannot be converted to StringBuilder by method invocation conversion)
    constructor String.String(StringBuffer) is not applicable
      (actual argument int cannot be converted to StringBuffer by method invocation conversion)
    constructor String.String(byte[]) is not applicable
      (actual argument int cannot be converted to byte[] by method invocation conversion)
    constructor String.String(byte[],int,int) is not applicable
      (actual and formal argument lists differ in length)
    constructor String.String(byte[],Charset) is not applicable
      (actual and formal a...