判断成绩:1
 class Program
    {
        static void Main(string[] args)
        {
            string x;
            int y;
            Console.Write("请输入考试成绩:");
            x = Console.ReadLine();
            y = Int32.Parse(x);
            if (y < 60)
            {
                Console.WriteLine("恭喜您,您没有通过本次考试!您的考试成绩为:{0}分", x);
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("很遗憾您通过了本次考试,您的成绩为:{0}分", x);
                Console.ReadLine();
            }
        }
    }
}
 
判断姓名是否:2
namespace aa
{
    class Program
    {
        static void Main(string[] args)
        {
            string name;
            Console.Write(" 请输入你的用户名:");
            name = Console.ReadLine();
            if (name == "grant")
            {
                Console.WriteLine("欢迎{0}回来!!!", name);
                Console.ReadKey();
            }
            {
                if (name != "grant")
                    Console.WriteLine("不好意思你不是她,请叫来过来输入名字,哈哈!!!");
                Console.ReadLine();
            }
       }
    }
}
 
检查输入字符是小写还是大写或是数字:3
namespace aa
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个字符");
            char a = (char)Console.Read();
            string b;
            if (char.IsUpper(a))//判断大写字母
            {
                b = "请输入你的字符是大写啊哈哈!!!";
            }
            else if (char.IsLower(a))//判断小写字母
            {
                b = " 请输入你的字符是小写啊,哈哈!!!";
            }
            else if (char.IsNumber(a))//判断你的数字
            {
                b = "请输入你的数字啊,哎不要输入错啊!!哈哈!!!";
            }
            else
                b = "你输入的即不是大写字符,也不是小写字母,也不是数字啊!搞好了输入!!!";
            Console.WriteLine(b);
            Console.ReadKey();
        }  
     }
}       
  

Do…while循环语句:4
namespace grant
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = 1;
            do
            {
                Console.WriteLine(n);
                n++;
            }
            while (n < 100);
            Console.ReadKey();
        }
    }
}
判断数字对应的星期:5
namespace grant
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("对应表:1=星期一,2=星期二,3=星期三");
            Console.Write("按照上面对应输入数字:");
            string a;
            int b;
            a = Console.ReadLine();
            b = int.Parse(a);
            string c;
            switch (b)
            {
                case 1:
                    c = "星期一";
                    break;
                case 2:
                    c = "星期二";
                    break;
                case 3:
                    c = "星期三";
                    break;
                default:
                    c = "你输的什么东东啊";
                    break;
            }
            Console.WriteLine("请输入你的字符:{0},对应的日期:{1}", b, c);
            Console.ReadLine();
        }
     }
}
 
Foreach循环::6
namespace grant
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] x = new char[] { 'g','r','n', 't', 'g', 'r','a', 't'};//定义数组x
            foreach (char y in x)//数组中的值赋予char类型变量y,并按照数组中的次数循环输出
            {
                Console .WriteLine (x);
            }
       Console.WriteLine ();//输出
       Console.ReadLine();//定   //呵呵!!!
        }
    }

   
   

数组的length属性:7
namespace grant
{
    class Program
    {
        static void Main(string[] args)
        {
            int[]s={0,1,2,3,4,5,6,7,8};
            int x=s.Length ;
            Console.WriteLine("s数组为{0}", x);
            Console.ReadLine ();
        }
    }
}