Last active
August 29, 2015 14:22
-
-
Save draqoon/b099d837d2fd274d07b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Paiza Lerning 足し算 (paizaランク D 相当) | |
//https://paiza.jp/learning/addition | |
using System; | |
public class Hello{ | |
public static void Main(){ | |
//標準入力から1行読み込み | |
string line = Console.ReadLine(); | |
//半角スペースで分割し、文字列配列に変換 | |
string[] parts = line.Split(' '); | |
//文字列配列を数値配列に変換 | |
int[] numbers = new int[parts.Length]; | |
for( int i = 0; i < parts.Length; i++ ) { | |
numbers[i] = int.Parse( parts[i] ); | |
} | |
//加算処理 | |
int result = numbers[0] + numbers[1]; | |
//標準出力に加算結果を出力 | |
Console.WriteLine( result ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment