AtCoder Beginner Contest 001

Submission #1434970

Source codeソースコード

using System;
using static System.Math;

public class Class1
{
    static void Main()
    {
        int deg = int.Parse(Console.ReadLine());
        int dis = int.Parse(Console.ReadLine());
        string dir = Deg(deg);
        if(Dis(Dis) == 0)
        {
            dir = 'c';
        }
        Console.WriteLine(dir + " " + Dis(dis));
    }
    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;
        float dis_sec = dis / 60;
        dis_sec = Math.Truncate(dis_sec * 10) / 10;
        if(dis_sec <= 0.2)
        {
            w = 0;
        }
        else if(dis_sec <= 1.5)
        {
            w = 1;
        }
        else if (dis_sec <= 3.3)
        {
            w = 2;
        }
        else if (dis_sec <= 5.4)
        {
            w = 3;
        }
        else if (dis_sec <= 7.9)
        {
            w = 4;
        }
        else if (dis_sec <= 10.7)
        {
            w = 5;
        }
        else if (dis_sec <= 13.8)
        {
            w = 6;
        }
        else if (dis_sec <= 17.1)
        {
            w = 7;
        }
        else if (dis_sec <= 20.7)
        {
            w = 8;
        }
        else if (dis_sec <= 24.4)
        {
            w = 9;
        }
        else if (dis_sec <= 28.4)
        {
            w = 10;
        }
        else if (dis_sec <= 32.6)
        {
            w = 11;
        }
        else
        {
            w = 12;
        }
        return w;
    }
}

Submission

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

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

./Main.cs(11,12): error CS1502: The best overloaded method match for `Class1.Dis(int)' has some invalid arguments
./Main.cs(42,16): (Location of the symbol related to previous error)
./Main.cs(11,16): error CS1503: Argument `#1' cannot convert `method group' expression to type `int'
./Main.cs(13,19): error CS0029: Cannot implicitly convert type `char' to `string'
./Main.cs(46,24): error CS0266: Cannot implicitly convert type `double' to `float'. An explicit conversion exists (are you missing a cast?)

Test case