Created
October 18, 2016 13:35
-
-
Save mokomokohitsuzi/98c2dad6b333079ec693e364e0f7c46e to your computer and use it in GitHub Desktop.
新・明解Java入門 演習3-9
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 java.util.Scanner; | |
public class En3_9 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); | |
System.out.print("実数値A:"); | |
double a = stdIn.nextDouble(); | |
System.out.print("実数値B:"); | |
double b = stdIn.nextDouble(); | |
// 三項演算子で結果を表示。 | |
System.out.println("大きい方の値は" + (a > b ? a : b) + "です。"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment