for(int i=0;;i++)
{
   console.write(i);
}
我的回答简直是丢程序员的脸,还是不说了...不知道这里有没人也不知道答案的.

解决方案 »

  1.   

    题都错了
    for(int i; i=0;;i++)
    {
       console.write(i);
    }
      

  2.   

    TO:
    题都错了
    for(int i; i=0;;i++)
    {
       console.write(i);
    }题怎么错了?无非是个死循环而已....
      

  3.   

    for(int i=0;;i++)
    {
       console.write(i);
    }
    这个题目也行...差点又马虎.
      

  4.   

    for(int i; i=0;;i++)
    {
       console.write(i);
    }这样编译能通过!是这样的吧?
    for(int i, i=0;;i++)
    {
       console.write(i);
    }
      

  5.   

    for (int i = 0; ; i++)
                {
                    Console.Write(i);
                }无限循环
      

  6.   

    我来更正一下吧.
    试题原题目
    int i;
    for(i=0;;i++)
    {
     }
    我写成
    for(int i=0;;i++)
    {
       console.write(i);
    }
    两种都行...
    楼上的那样写不能编译.
      

  7.   

    for(int i, i=0;;i++)
    {
       console.write(i);
    }通过不了。没试成功
      

  8.   

    for(int i, i=0;;i++)
    {
       console.write(i);
    }
    这个会出错,因为i没有初值for (int i = 0; ; i++)
                {
                    Console.Write(i);
                }
    当超过int的长度会出错,int有多长我忘了-_#基础都跟压饭底了
      

  9.   

    for(bool i; i=false; i=!i)
    {
        Console.Write(i);
    }这个更有意思。不过在C++中更好玩一点:for(int i; i=0; i++)
    {
        cout << i;
    }
      

  10.   

    for(int i; i=0;;i++)
    {
       console.write(i);
    }
    for(int i; i=0;;i++)这条语句能行吗?for(int i; 这里要求是一个Bool的;;i++)
    晕倒,有这个时间发这个贴,为啥不用C#写一个Demo试试看????
      

  11.   

    什么题目嘛看不懂,实在看不懂。
    本人感觉现在招聘方出的题目水平越来越低下了。比如1!+2!+...+n!这样的题目也出来了,没有足够的时间我看人事部的(如果纯嵌套实现)也不能在1个小时内完成。可能是太自大了。
    下面放我在笔试后的解决代码:
    using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;namespace _1__2____n_
    {
    /// <summary>
    /// Form1 的摘要说明。
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.TextBox textBox2;
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components = null; public Form1()
    {
    //
    // Windows 窗体设计器支持所必需的
    //
    InitializeComponent(); //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    //
    } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if (components != null) 
    {
    components.Dispose();
    }
    }
    base.Dispose( disposing );
    } #region Windows 窗体设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.textBox1 = new System.Windows.Forms.TextBox();
    this.label1 = new System.Windows.Forms.Label();
    this.button1 = new System.Windows.Forms.Button();
    this.textBox2 = new System.Windows.Forms.TextBox();
    this.SuspendLayout();
    // 
    // textBox1
    // 
    this.textBox1.Location = new System.Drawing.Point(24, 16);
    this.textBox1.Name = "textBox1";
    this.textBox1.Size = new System.Drawing.Size(128, 21);
    this.textBox1.TabIndex = 0;
    this.textBox1.Text = "输入一个自然数";
    // 
    // label1
    // 
    this.label1.Location = new System.Drawing.Point(32, 48);
    this.label1.Name = "label1";
    this.label1.Size = new System.Drawing.Size(136, 16);
    this.label1.TabIndex = 1;
    this.label1.Text = "结果在下面:";
    // 
    // button1
    // 
    this.button1.Location = new System.Drawing.Point(176, 16);
    this.button1.Name = "button1";
    this.button1.Size = new System.Drawing.Size(80, 24);
    this.button1.TabIndex = 0;
    this.button1.Text = "运行";
    this.button1.Click += new System.EventHandler(this.button1_Click);
    // 
    // textBox2
    // 
    this.textBox2.AutoSize = false;
    this.textBox2.Location = new System.Drawing.Point(8, 72);
    this.textBox2.Name = "textBox2";
    this.textBox2.Size = new System.Drawing.Size(256, 40);
    this.textBox2.TabIndex = 3;
    this.textBox2.Text = "";
    // 
    // Form1
    // 
    this.AcceptButton = this.button1;
    this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
    this.ClientSize = new System.Drawing.Size(280, 118);
    this.Controls.Add(this.textBox2);
    this.Controls.Add(this.button1);
    this.Controls.Add(this.label1);
    this.Controls.Add(this.textBox1);
    this.Name = "Form1";
    this.Text = "Form1";
    this.ResumeLayout(false); }
    #endregion /// <summary>
    /// 应用程序的主入口点。
    /// </summary>
    [STAThread]
    static void Main() 
    {
    Application.Run(new Form1());
    } private void button1_Click(object sender, System.EventArgs e)
    {
           int i=int.Parse(this.textBox1.Text);
       this.textBox2.Text=goon(i,i).ToString();
    } private int goon(int n,int k)
    {
    if(0==k&&0==n)return 1;
    else
    {
    if(0==k) return 0;
    else if(1==k)
    {
    if(1==n)return 1;
    else return n=n*goon(n-1,k);
    }
    else return goon(n,k-1)+goon(n-1,k-1)-goon(n-1,k-2);
    }
    }
    }
    }
      

  12.   


    for(int i=0;;i=i+1000000)
    {
       Console.WriteLine(i);
    }
    验证为死循环
      

  13.   

    题很不错的,主要是Int的范围的问题
      

  14.   

    for(int i=0;;i++)
    {
       console.write(i);
    }
    死循环,最后会溢出.
      

  15.   

    for(int i=0;true;i++)
    {
      Console.Write(i);
    }
      

  16.   

    应该是死循环了
    不过肯定超过int的范围肯定会报错的
      

  17.   

    for(int i=0;;i++)
     {
    Console.Write(i);
     }
    这应该时个死循环
    当int达到最大65536时抛出异常 我试了 就时不抛出异常
    怎么回事
      

  18.   

    死循环,不是什么int值范围考察
    汇编出来都是jmp循环跳转
      

  19.   

    for(;;)
    {
         Console.Write("i");
    }
      

  20.   

    做 
       int i;
       for(i=0;;i++)
       {
          printf("%d\n",i);
       }
    从0~32767就转入-32767~0
      

  21.   

    liyang19860104() 说得对!
    我刚作过试验!
      

  22.   

    iamcooky(绿蓑衣) 说的对我也得到了同样的数据
      

  23.   

    TO    ttpps() ( ) 信誉:100    Blog 
    回去好好学学数学好吗?基本的数学公式你不知道?
    要是出1+2---------+N的话估计你就会知道了
      

  24.   

    for (int i = 0; ; i=i+65535)
                {
                    Console.write(i);
                }
    不会有溢出,省略第二条件,第二条件黑认为True;所以死循环。
    不过还是觉得出题的人有点白痴变态。
      

  25.   

    靠,二楼吓我一大跳!
    还以为for里面可以使用三个冒号!
      

  26.   

    看了楼主的题目想起来一道题 是去年面试的时候
    在a.spx文件中有一段脚本如下,是为了传递数据到b.aspx中作为查询条件
    function IMG1_onclick(e)
      {
        var Url= "../Common/b.aspx";
        var Transforms =document.Form1.TxtSearchFile.value;
        var index;
        if(Transforms.length ==1)
        {
        for(index=0;index<1;index++)
        {
          if(Transforms.charCodeAt(index)>0x4E00||Transforms.charCodeAt(index)<0x9FA5)
          {
      
          }
        }
        }
          Url = Url+"?FileName="+Transforms+"&SearchIndex=1&SearchType="+document.Form1.Ddl_choicefile.value;
      e.target="Folders";
        e.href =Url; }
    可是数据传递到b.aspx中 会出现
    如果传递的是两个中文字符或者英文字母及单词都没有问题
    用request.querystring可以获得,但是一旦输入一个中文字符,就会出现解析不了
    调试的时候会出现string s =request.querystring["filename"];
    结果为:s="?filename=&fileindex=1";
    问为什么会出现以上的结果
      

  27.   

    for(int i=0;;i++)
    {
       Console.write(i);//应该大写Console
    }