using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int x, y;
            for (x = 0; x < 10; x++ System.Console.Write("\n"))
            for (y - 0; y< 10; y++)
                System.Console.Write("x")
        }
    }
}他提示我  for (y - 0; y< 10; y++) 这一句错误.错误 1 只有 assignment、call、increment、decrement 和 new 对象表达式可用作语句 D:\My Documents\Visual Studio 2008\Projects\ConsoleApplication6\ConsoleApplication6\Program.cs 14 22 ConsoleApplication6
高手解答一下

解决方案 »

  1.   

    不知道你是不是打错了,
    for (y - 0; y < 10; y++) 
    =>
    for (y = 0; y < 10; y++) 
      

  2.   

    很明显是这句错误。using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;namespace ConsoleApplication6
    {
        class Program
        {
            static void Main(string[] args)
            {
                int x, y;
                for (x = 0; x < 10; x++ System.Console.Write("\n"))
                for (y = 0; y< 10; y++)
                    System.Console.Write("x")
            }
        }
    } for (y = 0; y< 10; y++)
      

  3.   


     int x, y;
     for (x = 0; x < 10; x++) System.Console.Write("\n");
     for (y = 0; y< 10; y++)
     System.Console.Write("x");