C#例题3-1简单的程序

来源:互联网 发布:mysql 返回不重复数据 编辑:程序博客网 时间:2024/05/22 10:50

using  System;

public sealed class P3_1     //密封类,防止继承
{
       public static void Main()
        {
            int result;                                                   //c#语言中,变量必须要赋值,就像c++语言要有输入语句一样
            result = 9 * 6;
            int thirteen;
            thirteen = 13;
            Console.WriteLine(result/thirteen);//相当于C++语言中的输出语句
            Console.WriteLine(result%thirteen); 
        }
  
}



运行结果如下:


0 0
原创粉丝点击