分支-05. 用天平找小球(10)
时间限制
400 ms
内存限制
65536 kB
代码长度限制
8000 B
判题程序
Standard
三个球A、B、C,大小形状相同且其中有一个球与其他球重量不同。要求找出这个不一样的球。
输入格式:
输入在一行中给出3个正整数,顺序对应球A、B、C的重量。
输出格式:
在一行中输出唯一的那个不一样的球。
输入样例:1 1 2输出样例:
C
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); int a,b,c; a = input.nextInt(); b = input.nextInt(); c = input.nextInt(); if(a == b) { System.out.print("C"); } if(a == c) { System.out.print("B"); } if(b == c) { System.out.print("A"); } } }