0
点赞
收藏
分享

微信扫一扫

C#学习2


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

C#学习-Day2

C# Task类- 多线程学习2

【C#学习】

C#笔记-2

C#学习笔记

0 条评论