結果

問題 No.643 Two Operations No.2
ユーザー wagashi1349wagashi1349
提出日時 2018-02-22 17:41:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 614 bytes
コンパイル時間 2,975 ms
コンパイル使用メモリ 109,448 KB
実行使用メモリ 25,876 KB
最終ジャッジ日時 2024-10-01 21:22:56
合計ジャッジ時間 3,250 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            String line = Console.ReadLine();
            String[] s = line.Split(' ');
            int X = int.Parse(s[0]);
            int Y = int.Parse(s[1]);
            if (X == Y)
                Console.WriteLine(0);
            else if (X == 0)
                Console.WriteLine(2);
            else if (Y == 0)
                Console.WriteLine(1);
            else if (X == -Y)
                 Console.WriteLine(3);
            else
                Console.WriteLine(-1);
        }
    }
}
0