using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleAppFun
{
internal class Program
{
static void Main(string[] args)
{
hello();
sayHello("氨基丁酸");
string a = returnDay();
sayHello(a);
int n = 10;
addNumber(ref n);
hello(n);
Console.ReadKey();
}
static void hello(int a)
{
Console.WriteLine(a);
}
static void hello()
{
Console.WriteLine("hello");
}
/// <summary>
/// 有参无返回值参数
/// </summary>
/// <param name="name">姓名</param>
static void sayHello(string name)
{
Console.WriteLine(name);
}
static string returnDay() {
int a = 1;
string str;
if (a == 1)
{
str = "早上";
}
else {
str = "下午";
}
return str;
}
static void addNumber(ref int number)
{
number += 10;
}
}
}
C#学习2
最新推荐文章于 2024-11-11 18:25:13 发布