码家

Web Platform, Cloud and Mobile Application Development

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

using System;
public class Test
{
    public static void Main()
    {
        int n;
        while ((n = int.Parse(Console.ReadLine()))!=42)
            Console.WriteLine(n);
    }
}

1.不能去掉using System;

会报错

2.这里不需要namespace,就连public都可以去掉
3.最简单格式的命令行程序就是

class  类名

{

  public static void Main()
    {

    }

}

posted on 2011-04-03 17:03  海山  阅读(92)  评论(0)    收藏  举报