c# 类

来源:互联网 发布:linux系统ls命令 编辑:程序博客网 时间:2024/06/06 05:51
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace ConsoleApplication4
{
    class sayHello
    {
        double width;
        double height;
        public void getWidthAndHeight()
        {
           width = double.Parse(Console.ReadLine());
           height = double.Parse(Console.ReadLine());
            //return ;
        }
        public double haha()
        {
            return width * height; 
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            sayHello say = new sayHello();
            say.getWidthAndHeight();
            Console.WriteLine(say.haha());


            Console.ReadKey();
        }
    }
}
0 0
原创粉丝点击