1,main后面没有括号;
2. Console.WriteLine(); 改为console.Readline();
3.Console.WriteLine("Welcome") 后面少分号;
2. Console.WriteLine(); 改为console.Readline();
3.Console.WriteLine("Welcome") 后面少分号;
调试欢乐多
else if(10 <K <=20) 错误
运算符“<=”无法应用于“bool”和“int”类型的操作数,就是说先计算了10<K,它返回的是bool 自然无法和20比较了
2.for(i=1;i <=8,i++) 应该for(i=1;i <=8;i++)
*****************
****************
***************
**************
*************
************
***********
**********
3 int M() 在class Test 外面 无法调用
int M()返回类型为int 但是内部没有return
main()是静态的,不能访问非静态的int M()应改做static int M()
4
class MyClass
{
private int x;
public MyClass(int x)
{
this.x = x;
}
public void SetX(int a)
{
x = a;
}
}
class Test
{
static void Main()
{
MyClass m = new MyClass(18);
m.SetX(68);
}
}
5
1,6