03-2. 用天平找小球(10)

来源:互联网 发布:linux 服务器 家用 编辑:程序博客网 时间:2024/04/28 23:58

三个球A、B、C,大小形状相同且其中有一个球与其他球重量不同。要求找出这个不一样的球。

输入格式:

输入在一行中给出3个正整数,顺序对应球A、B、C的重量。

输出格式:

在一行中输出唯一的那个不一样的球。

输入样例:
1 1 2
输出样例:
C

#include<stdio.h>int main(){int a, b, c;scanf("%d %d %d", &a, &b, &c);if (a == b){printf("C");}else if (b == c){printf("A");}else if (a == c){printf("B");}return 0;}


0 0
原创粉丝点击