首页 > 其他 > 详细

摄氏度转成华氏度

时间:2014-12-03 21:17:36      阅读:236      评论:0      收藏:0      [点我收藏+]
//
//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();
        }
    }
}
bubuko.com,布布扣

摄氏度转成华氏度

原文:http://blog.csdn.net/hbd0616/article/details/41703047

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!