zoukankan      html  css  js  c++  java
  • 函数

    namespace ConsoleApplication1
    {
    class Program
    {
    //访问修饰符 函数名(参数1,参数2)
    //{
    //函数体
    //return 返回值
    //}
    /// <summary>
    /// 无参数,无返回值
    /// </summary>
    public static void abc()
    {
    Console.WriteLine("无参数,无返回值");
    }

    /// <summary>
    /// 无参数,有返回值
    /// </summary>
    /// <param name="args"></param>
    public static int abc2()
    {
    return 1;
    }

    /// <summary>
    /// 有参数,无返回值
    /// </summary>
    /// <param name="args"></param>
    public static void abc3(int a,int b)
    {
    Console.WriteLine(a + b);
    }
    /// <summary>
    /// 有参数,有返回值
    /// </summary>
    /// <param name="args"></param>
    public static int abc4(int x,int y)
    {
    return x * y;
    }
    struct stu
    {
    public int id;
    public string name;
    public DateTime birthday;
    public double mark;
    public int age;
    }
    static void Main(string[] args)
    {
    //abc();

    //Console.WriteLine(abc2());

    //abc3(1, 2);

    //Console.WriteLine(abc4(2, 3));
    //Console.WriteLine("请输入学生数");
    //int count = int.Parse(Console.ReadLine());
    //Console.WriteLine("请输入学生信息: ");

    //List<stu> st_list = new List<stu>();

    //for(int i = 1; i <= count; i++)
    //{
    // stu st;
    // Console.WriteLine("请输入第"+ i +"个学生学号");
    // st.id = int.Parse(Console.ReadLine());
    // Console.WriteLine("请输入第" + i + "个学生姓名");
    // st.name = Console.ReadLine();
    // Console.WriteLine("请输入第" + i + "个学生生日");
    // st.birthday = Convert.ToDateTime(Console.ReadLine());
    // Console.WriteLine("请输入第" + i + "个学生分数");
    // st.mark = Convert.ToDouble(Console.ReadLine());
    // //Console.WriteLine("请输入第" + i + "个学生年龄");
    // st.age = DateTime.Now.Year - st.birthday.Year;

    // st_list.Add(st);
    //}


    //foreach(var x in st_list)
    //{
    // Console.WriteLine(x.id+ " " + x.name + " " + x.birthday + " " + x.mark +" " + x.age + " ");
    //}
    ArrayList alt = new ArrayList();

    for(int i = 1; i <= 100; i++)
    {
    alt.Add(i);
    }

    for(int i = 49,j = 90; i <= 58&&j<=200; i++,j++)
    {

    alt.Insert(i, alt[j]);
    j++;

    }

    foreach(int x in alt)
    {
    Console.WriteLine(x);
    }

    Console.ReadLine();
    }
    }
    }

  • 相关阅读:
    mysql的缓冲查询和非缓冲查询
    通过中看不中用的代码分析Ioc容器,依赖注入....
    register_shutdown_function AND fastcgi_finish_request
    laravel5源码讲解整理
    ERROR! MySQL is running but PID file could not be found
    读《高性能javascript》笔记(一)
    看php手册2015-03-19版后备注
    rawurlencode / urlencode
    Zen Cart屏蔽中文语言浏览器
    WooCommerce Shortcode 简码使用方式说明
  • 原文地址:https://www.cnblogs.com/qwer123666/p/7001922.html
Copyright © 2011-2022 走看看