死循环 static void hello(int d,int e) { return d * e ; }
static void hello(int d,int e) { int c = d * e ; Console.WriteLine(c); hello(2,3); }这样就有输出了,不过不知道你到底想写个什么 另外默认是从Main进入程序的,也就是说默认情况下你增加了hello方法,但是什么都没执行 不知道你是不是设置了
谢谢ls的了,其实我只是想随便试一下怎么调用方法= =b,已经可以了 using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace ConsoleApplication6 { class Program { static int hello(int d,int e) { int c = d * e; return c; } static void Main(string[] args) {
static void hello(int d,int e)
{
return d * e ;
}
{
int c = d * e ;
Console.WriteLine(c);
hello(2,3);
}这样就有输出了,不过不知道你到底想写个什么
另外默认是从Main进入程序的,也就是说默认情况下你增加了hello方法,但是什么都没执行
不知道你是不是设置了
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace ConsoleApplication6
{
class Program
{
static int hello(int d,int e)
{
int c = d * e;
return c;
} static void Main(string[] args)
{
Console.WriteLine("result is : " + hello (2,3) );
}
}
}