helloxkcd


私信TA

用户名:helloxkcd

访问量:2855

签 名:

等  级
排  名 23813
经  验 566
参赛次数 2
文章发表 2
年  龄 18
在职情况 学生
学  校
专  业

  自我简介:

TA的其他文章

解题思路:
在纸上写一写所有有可能的组合

参考代码:

#include <stdio.h>
int main(void)
{
    int a,b,c,i,e,r,d;
    scanf("%d%d%d",&a,&b,&c); \\ 读取数据
    if(a>b)
        i = 1;  \\这里千万不要用int i=1;原因请看C error: Expected expression before int

         else
         i = 0;
    if(b>c)
         e = 1;
    else
         e = 0;
    if(c>a)
         r = 1;
    else
         r = 0;
    if(c>b)
         d = 1;
    else
         d = 0;
    if((e==1&&i==1)||(d==1&&i==1&&r==0))
        printf("%d\n",a);
    if((e==1&&i==0&&r==0&&d==0)||(r==1&&e==1))
        printf("%d\n",b);
    if(d==1&&r==1)
        printf("%d\n",c);
    return 0;
}

 

0.0分

0 人评分

  评论区