人生中第一个自己写的C#代码

2021年5月2日 0 作者 SimpleAstronaut

不废话,代码如下

using System;

namespace cstestApp
{
    class Box
    {
        int Longth;
        int Height;
        int weight;
        public void writeIn()
        {
            Longth = 10;
            Height = 25;
            weight = 13;
        }
        public double WriteOut(int num1,int num2,int num3)
        {
            int Result = num1 * num2 * num3;
            return Result;
        }
        public void MesgOut()
        {
            Console.WriteLine(WriteOut (Longth, Height, weight));
        }
    }
    class Mian
    {
        static void Main(string[] args)
        {
            int MainLongth=0, MainHeight=0, Mainweight = 0;
            Box r = new Box();
            r.writeIn();
            r.WriteOut(MainLongth,MainHeight,Mainweight);
            r.MesgOut();
            Console.ReadLine();
        }
    }
 
}