<img src="https://img-blog.csdn.net/20141011121447349?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhvbmd5YW5mdTA=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />//
// Copyright (c) 2014软件技术1班
// All rights reserved.
// 完成日期:2014年 10 月 10 日
// 版 本 号:v1.0
// 问题描述:创建一个程序来把华氏摄氏度转换成温度。该程序提示用户输入温度数据,然后显示出转换后的华氏摄氏度的数据。
// 输入描述:一个实数,代表温度
// 程序输出:一个实数,华氏摄氏度
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace p1_01HelloWorld
{
class Program
{
static void Main(string[] args)
{ double c,f;
Console.WriteLine("请输入温度数据");
c=Convert.ToDouble(Console.ReadLine()) ;
f = c * 9 / 5 + 32;
Console.WriteLine("{0}温度对应华氏摄氏度{1}",f,c);
Console.Read();
}
}
}
温度值的转换
最新推荐文章于 2023-01-06 23:00:38 发布