📄 program.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
namespace 重载方法
{
/*************************
* 程序描述:方法重载实例,使用同一个方法czt来实现求整数和浮点数的平方。
* 创 建 人:ncbcy@eiTarget
* 版 本 号:1.0.0
* 修改记录:0
************************/
class Program
{
static void Main(string[] args)
{
int intcz = 11;
float fltcz = 11.111f;
cz.czt(ref intcz);
cz.czt(ref fltcz);
Console.ReadLine();
}
}
class cz
{
static public void czt(ref int intcz)
{
Console.WriteLine("使用public void czt(ref int intcz)处理。\n\t\t" + intcz + "的平方为:" + intcz * intcz);
}
static public void czt(ref float fltcz)
{
Console.WriteLine("使用public void czt(ref float intcz)处理。\n\t\t" + fltcz + "的平方为:" + fltcz * fltcz);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -