华氏度摄氏度对照表输出

2018-09-14  本文已影响0人  优秀产品研习社

public class Demo16{

public  static  void main(String[] args){

//摄氏度:0~250

//  每一项 以20度 为间隔

//摄氏度:0  20  40  60  80  100

//华氏度:摄氏度*9/5.0+30

// 条目不能超过10条

int count = 0;

System.out.println("编号\t摄氏温度\t华氏温度");

for(int i = 0;i<=250;i+=20){

count ++;

double h = i * 9/5.0+32;//华氏温度

System.out.println(count+"\t"+i+"\t\t"+h);

if(count==10){

break;

}

}

}

}

上一篇 下一篇

猜你喜欢

热点阅读