运用Visual Studio测生肖

 时间:2026-04-21 23:05:02

1、打开Visual Studio程序软件,选择新建项目。

运用Visual Studio测生肖

2、选择Visual C#,控制应用台,然后确定。

运用Visual Studio测生肖

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];

运用Visual Studio测生肖

  • 10款超实用的JS图片特效
  • Eclipse调整虚拟内存的大小
  • 怎样用eclipse写一个java程序?
  • 如何设置QQ空间导航栏间距
  • 怎样在MySQL中创建表
  • 热门搜索
    脸上的痣怎么去掉 腿上有紫色的血纹是怎么回事 炒饼怎么做好吃 轮胎尺寸怎么看 儿童编发大全简单漂亮 大肚子怎么减 家常麻婆豆腐 香港城市大学怎么样 怎么抠图换背景 贝雷帽的编织方法