久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      c 語言怎么實現(xiàn)三個數(shù)大小排序

      c 語言怎么實現(xiàn)三個數(shù)大小排序

      c 語言怎么實現(xiàn)三個數(shù)大小排序?

      c語言實現(xiàn)三個數(shù)大小排序的方法:

      從控制臺輸入三個整數(shù)a,b,c,實現(xiàn)對這 3 個整數(shù)由小到大進行排序,使用 if 語句進行條件判斷,如果 a 大于 b,則借助于中間變量 temp 互換 a 與 b 值, 依此類推比較 a 與 c、b 與 c,最終結(jié)果即為 a、b、c 的升序排列。

      代碼:

      #include <stdio.h> int main() { int a, b, c, temp; scanf_s("%d%d%d", &a, &b, &c); if (a > b) { temp = a; a = b; b = temp; } if(a>c) { temp = a; a = c; c = temp; } if (b > c) { temp = b; b = c; c = temp; } printf("%d %d %d", a, b, c); return 0; }

      推薦教程:《C視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號