欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          c語言怎么輸入3個數(shù)輸出最大值

          方法:首先使用scanf()接收從鍵盤輸入的三個數(shù);然后使用“if else”語句比較三個數(shù)的大小,獲得最大值;最后使用print()函數(shù)將最大值輸出即可。

          c語言怎么輸入3個數(shù)輸出最大值

          本教程操作環(huán)境:windows7系統(tǒng)、c99版本、Dell G3電腦。

          c語言輸入3個數(shù)輸出最大值

          #include <stdio.h> int main() {     // 輸入abc輸出最大值     int a;     int b;     int c;     int max;     scanf("%d %d %d", &a, &b, &c); // 輸入請空格隔開最后回車     /* if (a > b) {         max = a;     } else {         max = b;     } */     max = a;     if (b > max) {         max = b;     }     if (c > max) {         max = c;     }     printf("%dn", max);     return 0;     }

          運行:

          c語言怎么輸入3個數(shù)輸出最大值

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