Created
December 25, 2013 15:32
-
-
Save shigemk2/8124244 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
import java.util.Scanner; | |
class Max3 { | |
public static void main(String[] args) { | |
Scanner stdIn = new Scanner(System.in); // 標準入力ストリーム | |
System.out.println("三つの整数の最大値を求めます"); | |
System.out.println("aの値: "); | |
int a = stdIn.nextInt(); // 入力 | |
System.out.println("bの値: "); | |
int b = stdIn.nextInt(); | |
System.out.println("cの値: "); | |
int c = stdIn.nextInt(); | |
int max = a; | |
if (b > max) max = b; | |
if (c > max) max = c; | |
System.out.println("最大値は" + max + "です"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment