using System
class hello
{
public static void Main()
{
string answer;            System.Console.WriteLine("Do you want me to write the two words?");
            System.Console.WriteLine("type y for  yes ;n for no. then<enter>");
            answer=System.Console.ReadLine();
if  (answer=="y")
 System.Console.WriteLine("hello world");
 System.Console.WriteLine("bye bye"); }
}
在控制台编译有错误!谢谢各位大哥!

解决方案 »

  1.   

    using System
    _____________________
    加个分号
    using System;
      

  2.   

    using System; //<---- needs a ;class hello
    {
    public static void Main()
    {
    string answer;            System.Console.WriteLine("Do you want me to write the two words?");
                System.Console.WriteLine("type y for  yes ;n for no. then<enter>"); //you need to make sure the literals are on the same line or use @
                answer=System.Console.ReadLine();
    if  (answer=="y")
     System.Console.WriteLine("hello world");
     System.Console.WriteLine("bye bye"); }
    }
      

  3.   

    谢谢各位大哥:
                
                请教,为什么没有提示我输入东西呢?
    还有 saucer 大哥//you need to make sure the literals are on the same line or use @
     是什么意思啊?谢谢!
      

  4.   

    saucer 大哥不知道有没有空来看呢
    我帮你翻译一下,这句话的意思是:
    你必须确保这些文字在同一行,或者使用@因为你的那些在“”之间的句子都换行了,所以也会引起编译出错。
      

  5.   

    if  (answer=="y")
       System.Console.WriteLine("hello world");
    else <- 少了个else
       System.Console.WriteLine("bye bye");
      

  6.   

    我敲入 
           c:\kk#f>csc aa.cs可是出现的是:microsoft <R> Visual C# .NET Compiler version 7.10.3052.4
    for Microsoft <R> .NET Framework version 1.1.4322
    Copyright <C> Microsoft Corporation 2001-2002. All rights reserved.
    c:\kk#f>
    可是根本没有 出现Do you want me to write the two words?
    type y for  yes ;n for no. then<enter>.
    请教各位大哥,我是错在哪里啊,还是有什么东西没有配置好呢?
    谢谢各位大哥!
      

  7.   

    ruihuahan 大哥:
     您说在 命令行键入aa,运行此程序
    是不是 打开 :开始---》运行在里面输入 aa 
    可是我里面输入 aa  不行啊~~请大哥在说详细点啊
    谢谢!
      

  8.   

    开始->运行->首先要找到aa所在的路径,然后输入aa
      

  9.   

    ruihuahan 大哥 和 czsxj大哥:
    我输入 c:\kk#f\aa出现了Do you want me to write the two words?
    type y for  yes ;n for no. then<enter>.当我输入  y  并按下 <Enter>
    可是 屏幕是一闪就逝了(一下子就消失了),很难看清楚效果。
    请教各位大哥,有没有办法呢?谢谢!
      

  10.   

    在System.Console.WriteLine("bye bye");
    后面加上
    System.Console.ReadLine();
      

  11.   

    在System.Console.WriteLine("hello world");后面加个断点试试?
    小弟也是刚由ASP转型的新手,做网页的,说错了望包含!
      

  12.   

    非常感谢 czsxj 大哥和 aspme 大哥:
    czsxj 大哥 
    后面加上
    System.Console.ReadLine();
    还是不行啊~~aspme 大哥,因为我是写在 记事本里,我不知道怎么设置断点啊!
    谢谢各位大哥!
      

  13.   

    在System.Console.WriteLine("bye bye");
    后面加上
    System.Console.WriterLine("按任意键推出");
    System.Console.ReadLine();此句话的意思是等待输入,回车敲多了,还是会一闪而过的
      

  14.   

    czsxj 大哥:
    您说 回车敲多了,还是会一闪而过的 
    确实是这样,第一次是有一段时间才消失的再次感谢大哥!