zoukankan      html  css  js  c++  java
  • C#练习3

    using System;
    class Test
    {
      static void F(params int[]args)
      {
          Console.WriteLine("# of argument:{0}",args.Length);
          for(int i=0;i<args.Length;i++)
              Console.WriteLine("	args[{0}]={1}",i,args[i]);
      }
      static void Main()
      {
          F();//没有参数,默认传递的是 new int[0],但不是null
          F(1);
          F(1, 2);
          F(1, 2, 3);
          F(new int[] { 1, 2, 3, 4 });
      }
    }
    using System;
    public class Stack
    {
        private Node first = null;
        public bool Empty
        {
            get
            {
                return (first == null);
            }
        }
        public object Pop()
        {
            if (first == null)
                throw new Exception("Can't Pop from an empty Stack.");
            else
            {
                object temp = first.Value;
                first = first.Next;
                return temp;
            }
        }
        public void push(object o)
        {
            first = new Node(o, first);
        }
        class Node
        {
            public Node Next;
            public object Value;
            public Node(object value) : this(value, null) { }
            public Node(object value,Node next)
            {
                Next = next;
                Value = value;
            }
        }
    }
  • 相关阅读:
    Excel Sheet Column Number
    HappyNum
    isIsomorphic
    Contains DuplicateII
    iis7 设置http 自动跳转到https
    php 安装redis
    java 打包 war包
    NPOI 操作excel之 将图片插入到指定位置;
    nopi 简洁笔记
    vs11 微软下载地址
  • 原文地址:https://www.cnblogs.com/zhangyongjian/p/3579612.html
Copyright © 2011-2022 走看看