QtC++与QLabel详解

阅读 54

2023-11-05

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)

0 0 举报