这段码有没有问题呀,我在VC++2010和codeblocks都运行失败,但在啊哈C里面运行成功了,为什么呀🤣


#include<stdio.h>
#include<stdlib.h>

int main()
{
    int a,b,c,t;
    scanf("%d %d %d",&a,&b,&c);
    if(a<b)
    {
        t=a;
        a=b;
        b=t;
    }
    if(a<c)
    {
        t=a;
        a=c;
        c=t;
    }
    if(b<c)
    {
        t=b;
        b=c;
        c=t;
    }

    printf("%d %d %d",a,b,c);

system("pause");
return 0;
}

没有问题,可能你的环境没配好

运行失败报错截图看下

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a,b,c,t;
    scanf("%d %d %d",&a,&b,&c);
    if(a<b)
    {
        t=a;
        a=b;
        b=t;
    }
    if(a<c)
    {
        t=a;
        a=c;
        c=t;
    }
    if(b<c)
    {
        t=b;
        b=c;
        c=t;
    }
    printf("%d %d %d",a,b,c);
system("pause");
return 0;
}

在devc++上运行如图:

img


代码应该是没啥问题的,可以运行的,实在不行的话就把这一句system("pause");(只是推测,可能不是这的原因)去掉试试
希望对题主有所帮助,望采纳!!

要不把

system("pause");

注释掉,看看能运行不

img


VSC++ 2010 正常,输入数字后空格,输入完成后回车,