| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 497 人关注过本帖
标题:求最大值代码 请高手帮忙改动 让程序球玩最大值后出现继续或结束的选项
只看楼主 加入收藏
戒你》如烟
Rank: 1
等 级:新手上路
帖 子:5
专家分:2
注 册:2011-6-27
收藏
 问题点数:0 回复次数:0 
求最大值代码 请高手帮忙改动 让程序球玩最大值后出现继续或结束的选项



using System;
namespace Calculateion
{
    class CalculateNumber
    {
        int Number1, Number2, ;
        char option;
        int Result;
        public void Number()
        {
            Console.WriteLine("Enter the First number");
            Number1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter the second number");
            Number2 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Main Menu");
            Console.WriteLine("1.Addition");
            Console.WriteLine("2.Subtraction");
            Console.WriteLine("3.Multiplication");
            Console.WriteLine("4.Division");
            Console.WriteLine("Enter the Operation you want to perform");
            option = Convert.ToChar(Console.ReadLine());
               
            switch (option)
            {
                case '1':
                    Result = Number1 + Number2;
                    Console.WriteLine("The result of addition is:{0}",Result);
                    break;
                case '2':
                    Result = Number1 - Number2;
                    Console.WriteLine("The result of subtraction is:{0}",Result);
                   break
                case '3':
                    Result = Number1 * Number2;
                    Console.WriteLine("The result of multiplication is:{0}",Result);
                    break;
                case '4':
                    Result = Number1 / Number2;
                    Console.WriteLine("The result of division is:{0}",Result);
                    break;
                default:
                    Console.WriteLine("Invalid Option");
                   break;
            }
            Console.ReadLine();
                    
        }
               
    }
    class ClassMain
    {
        static void Main(string[] args)
        {
            CalculateNumber obj = new CalculateNumber();
            obj.Number();
        }
    }
}
搜索更多相关主题的帖子: class public number option second 
2011-09-20 08:49
快速回复:求最大值代码 请高手帮忙改动 让程序球玩最大值后出现继续或结束的 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039921 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved