代码:using System;class hello
{
public static void Main()
{
string svb;
Console.WriteLine("yes or no?");
svb=Console.ReadLine();
if (svb == 'y')
{
Console.WriteLine("hello world!!");
}
Console.WriteLine("bye bye!!");
}
};出错提示:yon.cs(10,7): error CS0019: 运算符“==”无法应用于“string”和“char”类型的操作数这个例子我是直接抄袭的教材上的,怎么解决呢?
{
public static void Main()
{
string svb;
Console.WriteLine("yes or no?");
svb=Console.ReadLine();
if (svb == 'y')
{
Console.WriteLine("hello world!!");
}
Console.WriteLine("bye bye!!");
}
};出错提示:yon.cs(10,7): error CS0019: 运算符“==”无法应用于“string”和“char”类型的操作数这个例子我是直接抄袭的教材上的,怎么解决呢?
解决方案 »
- 有關Regular Expression, 不太懂...
- Windows Service中MessageBox的弹出问题
- ######当动态库函数返回的是一个结构的时候....顶者有分!!!
- 高分求助,如何在windows form 的 datagrid 上实现双击事件?
- 怎么解决?当前线程不在单线程单元中,因此无法实例化 ActiveX 控件
- 关于DropDownList控件条件限制查询
- 求助!一条简单的正则表达式!
- 请教各位高人 教教我如何创建数据访问层? 谢谢!!!
- VTxtAuto的问题,请高手解决
- COMException 异常
- 困惑一问:窗体最前端显示
- 一个datagrid结合存储过程参数的查询显示问题
{
public static void Main()
{
string svb;
Console.WriteLine("yes or no?");
svb=Console.ReadLine();
if (svb == "y")
{
Console.WriteLine("hello world!!");
}
Console.WriteLine("bye bye!!");
}
};
using System;class hello
{
public static void Main()
{
string svb;
Console.WriteLine("yes or no?");
svb=Console.ReadLine();
if (svb == "y")
{
Console.WriteLine("hello world!!");
}
Console.WriteLine("bye bye!!");
}
};