Visual Studio推出的开发环境,是目前最流行的Windows平台应用程序开发环境。初学者会涉及一些有趣的程序,比如;根据你的出生测生肖。
工具/原料
1
Visual Studio软件
2
电脑
方法/步骤
1
打开Visual Studio程序软件,选择新建项目。
2
选择Visual C#,控制应用台,然后确定。
3
最后就可以写程序了,生肖的代码static void Main(string[] args) { Console.Write('年份:'); int n; n = int.Parse(Console.ReadLine()); Console.WriteLine(n + '年的生肖是:' + calxs(n)); Console.ReadLine(); } static public String calxs(int year) { int i = year % 12; String[] name = { '猴', '鸡', '狗', '猪', '鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊' }; return name[i];
注意事项
所用的标点符号必须全部是英文状态下的
下一篇:beatsx右耳没声音怎么办