using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;namespace ConsoleApplication34
{
    class Program
    {
        class people
        {
            public string name;
            public int age;
            public string Name
            {
                get
                {
                    return name;
                  
                }
                set
                {
                    name = value;
                
                }
            
            }            public int Age
            {
                get
                {
                    return age;
                
                }
                set
                {
                    if (age > 0 && age < 120)
                    {
                        age = value;
                     
                    }
                    else
                    { throw new ArgumentOutOfRangeException("MyIntProp", value, "MyIntProp must be assingned a value between 0 and 120"); }                }
            
            }            public people(string name, int age)
            {
                this.name = name;
                this.age = age;
             
            
            }
            public void speak()
            {                Console.WriteLine("我是{0},年龄:{1}",name,age);
            
            }
            
        }
        
        static void Main(string[] args)
        {            people op = new people("d",133);
            op.speak();            Console.ReadKey();
          
        
        }    }
}