设为首页 加入收藏

TOP

摄氏度转成华氏度
2015-01-26 23:16:28 】 浏览:3405
Tags:摄氏度 华氏
//
//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();
        }
    }
}

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C++输入输出流的基本函数及语法 下一篇用函数来比较两个数的最大值

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目