namespace Text {
class Program{
static void Main(spring[] args){ //static 静态, void 返回值, spring[] 参数 类型为一个字符串数组,args 参数名称
}
}
}
class Program{
static void Main(spring[] args){ //static 静态, void 返回值, spring[] 参数 类型为一个字符串数组,args 参数名称
}
}
}
error CS5001: Program `Program.exe' does not contain a static `Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
我为什么一直提示这个错误,复制同学代码也还是这样
Compilation failed: 1 error(s), 0 warnings
我为什么一直提示这个错误,复制同学代码也还是这样
2018-05-04
//声明整型数组,保存一组整数
int[] num = new int[] { 3,34,42,2,11,19,30,55,20};
//请完善代码,循环打印数组中的偶数
for (int i=0;i<num.Length;i++) {
if(num[i]%2==0){
Console.Write(num[i]+",");
}
}
int[] num = new int[] { 3,34,42,2,11,19,30,55,20};
//请完善代码,循环打印数组中的偶数
for (int i=0;i<num.Length;i++) {
if(num[i]%2==0){
Console.Write(num[i]+",");
}
}
char[,] ch = { {'我','是','软'},
{'件','工','程'},
{'师','啦','!'}};
Console.WriteLine("{0}{1}{2}",ch[1,1],ch[1,2],ch[2,0]);
这么看就容易理解了
{'件','工','程'},
{'师','啦','!'}};
Console.WriteLine("{0}{1}{2}",ch[1,1],ch[1,2],ch[2,0]);
这么看就容易理解了
2018-04-30
namespace Test
{
class Program
{
static void Main(string[] args)
{
double d = 2.5;
int x = (int)d + 1;
Console.WriteLine(x);
}
}
}
{
class Program
{
static void Main(string[] args)
{
double d = 2.5;
int x = (int)d + 1;
Console.WriteLine(x);
}
}
}
2018-04-29
int x,sum,temp;
x = 30;
temp = x;
sum = 0;
while (x > 0)
{
if (x % 2 == 1)
sum += x;
x--;
}
Console.WriteLine("1到{0}的奇数和为{1}",temp,sum);
x = 30;
temp = x;
sum = 0;
while (x > 0)
{
if (x % 2 == 1)
sum += x;
x--;
}
Console.WriteLine("1到{0}的奇数和为{1}",temp,sum);
2018-04-29