天天看點

C語言溫度

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

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {


    int i;
    int fahr,celsius;
    int lower,upper,step;
    lower = 0;//溫度表的下限 
    upper = 300;//溫度表的上限 
    step = 20;//步長
    
    fahr = lower;
     while(fahr<=upper){
         celsius = 5 *(fahr-32)/9;
         printf("%d\t%d\n",fahr,celsius);
         fahr=fahr+step;
    }
     scanf("%s",&i);
    return 0;
    
}      

網名:浩秦;

郵箱:root#landv.pw;

隻要我能控制一個國家的貨幣發行,我不在乎誰制定法律。金錢一旦作響,壞話隨之戛然而止。

繼續閱讀