大家好!我是一只菜鸟!请大家帮个忙!这是我写的一个程序!
请大家看一下它错在哪儿?该怎么改?
using System;
class test
{
public static void class Main()
{
Console.WriteLine(!(a && (d==int(e)) && (e/0.5)==5));
}
}
我的目的是想输出!(a && (d==int(e)) && (e/0.5)==5
的结果哈!
请大家看一下它错在哪儿?该怎么改?
using System;
class test
{
public static void class Main()
{
Console.WriteLine(!(a && (d==int(e)) && (e/0.5)==5));
}
}
我的目的是想输出!(a && (d==int(e)) && (e/0.5)==5
的结果哈!
解决方案 »
- C#应用程序出现faulting module unknown
- 寻找懂VC++和C#的同学,帮忙翻译一段C++的程序
- 这个时间段的SQL语句该怎么写?
- 有什么办法在指定的时间执行指定的操作
- C#反射的一个问题
- 请问为什么只一个简单的C#的winform就要占十几M的内存啊?
- 急需.net初学者源代码
- WinForm下的dataGrid问题2
- 这个问题有点难,如果已打开10个MDI子窗体,请问如何能才同时保存这10个子窗体中的数据?
- 两个winform间的问题
- ===========100分,请教打开excel文件的方法 c#=============
- 急!!!指定的参数已超出有效值的范围。参数名: slidingExpiration
我现在声明 了后还是有错!~
我现在的程序是这样!
using System;
class test
{
public static class Main()
{
bool a=true, b=true,c=false;
int d=3;
long e=2.5;
Console.WriteLine(!(a && (d==int(e)) && (e/0.5)==5));
}
}但它报错是这样说的
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(9): 类、结构或接口成员声明中的标记“&&”无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(9): 类、结构或接口成员声明中的标记“(”无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(9): 类、结构或接口成员声明中的标记“(”无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(9): 类、结构或接口成员声明中的标记“)”无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(9): 类、结构或接口成员声明中的标记“/”无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(9): 类、结构或接口成员声明中的标记“==”无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(4): 修饰符“static”对该项无效
D:\ASP.NET源代码\新建文件夹\3\Class1.cs(4): 应输入 {
class test
{
public static void Main()
{
bool a=true, b=true,c=false;
int d=3;
long e=(long)2.5; //2.5是小数,默认为double型
Console.WriteLine(!(a && (d==(int)e) && (e/0.5)==5));
}
}
{
bool a=true, b=true,c=false;
int d=3;
long e=2.5;
Console.WriteLine(!(a && (d==int(e)) && (e/0.5)==5));2.5的类型不能用long double或者float
没int(e)这样的写法吧在C#里。
直接E
好了
public static class Main() -----》static viod main()好了///////////////////////
using System;
class test
{
static void Main()
{
bool a=true, b=true,c=false;
int d=3;
double e=2.5;
Console.WriteLine(!(a && (d==e) && (e/0.5)==5));
}
}
int b = (int)a; 这个就有的b=3