?? 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 + -