摄氏度转成华氏度

来源:互联网 发布:仿制印章工具怎么用mac 编辑:程序博客网 时间:2024/04/29 08:40
////copyright(c) 2014软件技术1班//All rights reserved.//作者:A36黄阿德//完成日期:2014年12月3日//版本号:v1.0////问题描述:创建一个程序来把摄氏度转成华氏度。//输入描述:一个实数,代表摄氏度//using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            double centigrade, fahrenheit;//定义变量centigade:摄氏度,fahrenheit:华氏度            Console.WriteLine("请输入摄氏度:(C)");//提示输入摄氏度            centigrade = double.Parse(Console.ReadLine());//用户输入            fahrenheit = centigrade * 9 / 5 + 32;//摄氏度转换成华氏度            Console.WriteLine("{0} 摄氏度-----华氏度 {1} ", centigrade, fahrenheit);            Console.ReadKey();        }    }}

0 0
原创粉丝点击