Last active
October 2, 2016 12:56
-
-
Save mokomokohitsuzi/25fe7cd07e7687e6c37e971a19da98f7 to your computer and use it in GitHub Desktop.
新・明解Java入門 演習2-4
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
//スキャナーのimport文を設定。 | |
import java.util.Scanner; | |
public class En2_4 { | |
public static void main(String[] args) { | |
// スキャナー変数を宣言。 | |
Scanner stdIn = new Scanner(System.in); | |
System.out.print("整数値:"); | |
// 変数seisuに整数値を読み込む。 | |
int seisu = stdIn.nextInt(); | |
// 結果を出力 | |
System.out.println("10を加えた値は" + (seisu + 10) + "です。"); | |
System.out.println("10を減じた値は" + (seisu - 10) + "です。"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment