AtCoder Beginner Contest 001

Submission #1435160

Source codeソースコード

using System;

public class Class1
{
    static double[] wlist = { 0.2,1.5,3.3,5.4,7.9,10.7,13.8,17.1,20.8,24.4,28.4,32.6}; 
    static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        int deg = int.Parse(input[0]);
        int dis = int.Parse(input[1]);
        string dir_string = Deg(deg);
        int w = Dis(dis);
        if(w == 0)
        {
            dir_string = "C";
        }
        Console.WriteLine(dir_string+" "+w);
    }
    static string Deg(int deg)
    {
        string dir;
        int dir_int = deg / 225;
        switch (dir_int)
        {
            case 1: dir = "NNE";break;
            case 2: dir = "NE";break;
            case 3: dir = "ENE";break;
            case 4: dir = "E";break;
            case 5: dir = "ESE";break;
            case 6: dir = "SE";break;
            case 7: dir = "SSE";break;
            case 8: dir = "S";break;
            case 9: dir = "SSW";break;
            case 10: dir = "SW";break;
            case 11: dir = "WSW";break;
            case 12: dir = "W";break;
            case 13: dir = "WNW";break;
            case 14: dir = "NW";break;
            case 15: dir = "NNW";break;
            default:dir = "N";break;
        }
        return dir;
    }
    static int Dis(int dis)
    {
        int w;
        for(int i = 0; i < wlist.Length; i++)
        {
            if(dis <= wlist[i] * 60)
            {
                w = i;
                break;
            }
            else if(i == wlist.Length - 1)
            {
                w = 12;
            }
        }
        return w;
    }
}

Submission

Task問題 C - 風力観測
User nameユーザ名 keel
Created time投稿日時
Language言語 C# (Mono 4.6.2.0)
Status状態 CE
Score得点 -
Source lengthソースコード長 1659 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cs(59,16): error CS0165: Use of unassigned local variable `w'

Test case