class1.cs
来自「csharp-solution,C#高效编程源码」· CS 代码 · 共 35 行
CS
35 行
namespace Divider
{
using System;
/// <summary>
/// This program divides one number by another and displays the result
/// </summary>
public class DivideIt
{
public static int Main(string[] args)
{
try {
int i, j;
string temp;
Console.WriteLine ("Please enter the first integer");
temp = Console.ReadLine();
i = Int32.Parse(temp);
Console.WriteLine ("Please enter the second integer");
temp = Console.ReadLine();
j = Int32.Parse(temp);
int k = i / j;
Console.WriteLine("The result of dividing {0} by {1} is {2}", i, j, k);
} catch(Exception e) {
Console.WriteLine("An exception was thrown: {0}", e);
}
return 0;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?