Submission #285627


Source Code Expand

import java.util.Scanner;


public class Main {

	
	
	public static final String[] hougakuTable = 
		{"N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW",
		"WSW","W","WNW","NW","NNW"};
	
	//対応風力の10倍
	public static final int[] windPower10Table =
		{2, 15, 33, 54, 79, 107, 138, 171, 207, 244, 284, 326, 999};
	
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		
		int deg = scan.nextInt();
		int dis = scan.nextInt();
		
		//角度の計算
		//225刻みで変化
		int hougakuIndex = 0;
		String hougaku;
		deg = deg * 10; //10倍に
		while(1125 <= deg){
			deg -= 2250;
			hougakuIndex++;
		}
		hougaku = hougakuTable[hougakuIndex % 16];
		
		//風力の計算
		
		double windPower = (double)dis / (double)60;
		
		int windPower10 = (int)Math.round(windPower * 10);
		int windPowerIndex = 0;
		while( windPower10Table[windPowerIndex] < windPower10){
			windPowerIndex++;
		}
		
		if(windPowerIndex == 0){
			hougaku = "C";
		}
		
		System.out.printf("%s %d",hougaku, windPowerIndex);
		
	}
}

Submission Info

Submission Time
Task C - 風力観測
User marshkip
Language C++ (G++ 4.6.4)
Score 0
Code Size 1102 Byte
Status CE

Compile Error

./Main.cpp:1:1: error: ‘import’ does not name a type
./Main.cpp:4:1: error: expected unqualified-id before ‘public’