7-9 用天平找小球 (10point(s)).c

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

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

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

1 1 2

输出样例:

C

Note case!!!

//  date:2020/3/5
//  author:xiezhg5
#include <stdio.h>
int main(void)
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a==b)
    printf("C\n");
    else if(a==c)
    printf("B\n");
    else
    printf("A\n");
    return 0;
}
发布了30 篇原创文章 · 获赞 10 · 访问量 283

猜你喜欢

转载自blog.csdn.net/qq_45645641/article/details/104672024