0
点赞
收藏
分享

微信扫一扫

QtC++与QLabel详解

雅典娜的棒槌 2023-11-05 阅读 53
using System;

namespace ConsoleApp1
{
    class Rectangle
    {
        double length;
        double width;
        public Rectangle(double h, double w)
        {
            this.length = h;
            this.width = w;
        }
        public double getarea()
        {
            return length * width;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            double w, h;
            w = Convert.ToDouble(Console.ReadLine());
            h = Convert.ToDouble(Console.ReadLine());
            Rectangle R = new Rectangle(w, h);
            Console.WriteLine("矩形面积为{0}", R.getarea());
            Console.ReadLine();


        }
    }
}
举报

相关推荐

0 条评论