以下是代码using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace Ex02
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Console.WriteLine("-----------------------------------------------------------");
            Console.WriteLine("-----------------------------------------------------------");
            Console.WriteLine("---------------------趣味猜数字游戏------------------------");
            Console.WriteLine("---------------------              ------------------------");
            Console.WriteLine("---------------------版权所有人:Y------------------------");
            Console.WriteLine("-----------------------------------------------------------");
            Console.WriteLine("-----------------------------------------------------------");
            Console.WriteLine();            
            int guess; 
            int min;    
            int max;    
            int put;    
            string tmp; 
            Random r = new Random();  
            
            guess=r.Next(1, 100);   
            min=1;                 
            max=100;                           
            Console.WriteLine("待猜数字已生成,范围是1至100\n");        }
    }
}
不知道是不是这样排的,现在运行调试程序是一闪而过,没有停留的画面。弄得一头雾水
还有WriteLine Random Next这里一定要区分大小写字母吗?
我是新手,请别见笑。第一次在csdn发帖

解决方案 »

  1.   

    下面加一句
    Console.ReadLine();
      

  2.   

    Console.WriteLine("待猜数字已生成,范围是1至100\n");这这句的后面加一句: Console.Read();
      

  3.   

    Console.WriteLine("待猜数字已生成,范围是1至100\n");
    加上断点
      

  4.   

    楼上说的对 而且
    你的
    int guess;  
      int min;   
      int max;   
      int put;   
      string tmp;  
      Random r = new Random();   
        
      guess=r.Next(1, 100);   
      min=1;   
      max=100;
    这些代码都没用武之地  你都没用它们
    翻书看下控制台输入输出的知识点
      

  5.   

    在main的最后加上一行代码ocnsole.readline();