回覆列表
  • 1 # 微笑的水歲月薄荷微

    inta,b,c;

    intmin,max,between;

    min=(a<b)?((a<c)?a:c):((b<c)?b:c);

    max=(a>b)?((a>c)?a:c):((b>c)?b:c);

    示例如下:

    #include<stdio.h>

    voidmain()

    {

    inta,b,c;

    intmin,max,between;

    printf("輸入三個整數:");

    scanf("%d%d%d",&a,&b,&c);

    min=(a<b)?((a<c)?a:c):((b<c)?b:c);

    max=(a>b)?((a>c)?a:c):((b>c)?b:c);

    between=(a>b)?((a>c)?((b>c)?b:c):a):((b>c)?((c>a)?c:a):b);

    printf("從小到大排列為:%d%d%d",min,between,max);

    }

  • 中秋節和大豐收的關聯?
  • 如何看待武警用人牆做成的“人牆紅燈”?