From 060163d3800c94e1d58d7b1d588c51a779b2b0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Wed, 12 Mar 2025 07:32:35 +0000 Subject: [PATCH 01/46] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80=E6=BA=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄旻洁 <2955857091@qq.com> --- test1-original-code/1.1.txt | 24 +++++++ test1-original-code/1.10.txt | 13 ++++ test1-original-code/1.11.txt | 122 +++++++++++++++++++++++++++++++++++ test1-original-code/1.2.txt | 35 ++++++++++ test1-original-code/1.3.txt | 35 ++++++++++ test1-original-code/1.4.txt | 22 +++++++ test1-original-code/1.5.txt | 24 +++++++ test1-original-code/1.6.txt | 32 +++++++++ test1-original-code/1.7.txt | 55 ++++++++++++++++ test1-original-code/1.8.txt | 35 ++++++++++ test1-original-code/1.9.txt | 22 +++++++ 11 files changed, 419 insertions(+) create mode 100644 test1-original-code/1.1.txt create mode 100644 test1-original-code/1.10.txt create mode 100644 test1-original-code/1.11.txt create mode 100644 test1-original-code/1.2.txt create mode 100644 test1-original-code/1.3.txt create mode 100644 test1-original-code/1.4.txt create mode 100644 test1-original-code/1.5.txt create mode 100644 test1-original-code/1.6.txt create mode 100644 test1-original-code/1.7.txt create mode 100644 test1-original-code/1.8.txt create mode 100644 test1-original-code/1.9.txt diff --git a/test1-original-code/1.1.txt b/test1-original-code/1.1.txt new file mode 100644 index 00000000..f59d00ca --- /dev/null +++ b/test1-original-code/1.1.txt @@ -0,0 +1,24 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Main(string[] args)//主方法,程序入口 + { + int n1 = 10; + int n2 = 20; + int transnum;//用来转换的变量 + + transnum = n1; + n1 = n2; + n2 = transnum; + + Console.WriteLine($"n1 = {n1}, n2 = {n2}"); + } + } +} diff --git a/test1-original-code/1.10.txt b/test1-original-code/1.10.txt new file mode 100644 index 00000000..71be8a7b --- /dev/null +++ b/test1-original-code/1.10.txt @@ -0,0 +1,13 @@ +using System; +class Program +{ + static void Main() + { + string input = " Hello World ! 你好 世界 ! "; + + // 先去掉首尾空格 -> 按空格分割(去掉多余空格)-> 用单个空格拼接 + string result = string.Join(" ", input.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)); + + Console.WriteLine($"处理后字符串: \"{result}\""); + } +} diff --git a/test1-original-code/1.11.txt b/test1-original-code/1.11.txt new file mode 100644 index 00000000..79048948 --- /dev/null +++ b/test1-original-code/1.11.txt @@ -0,0 +1,122 @@ +using System; + +namespace RockPaperScissors +{ + // 枚举定义游戏选项 + public enum Choice + { + Scissors = 1, // 剪刀 + Rock = 2, // 石头 + Paper = 3 // 布 + } + + // 玩家类 + class Player + { + public string Name { get; set; } + + public Player(string name) + { + Name = name; + } + + // 玩家选择出拳 + public Choice MakeChoice() + { + while (true) + { + Console.Write("请选择:1. 剪刀 2. 石头 3. 布 :"); + string input = Console.ReadLine(); + + if (int.TryParse(input, out int choice) && choice >= 1 && choice <= 3) + { + return (Choice)choice; + } + Console.WriteLine("输入无效,请输入 1-3 之间的数字!"); + } + } + } + + // 电脑类 + class Computer + { + private static readonly Random random = new Random(); + + // 电脑随机出拳 + public Choice MakeChoice() + { + return (Choice)random.Next(1, 4); + } + } + + // 游戏逻辑类 + class Game + { + private Player player; + private Computer computer; + + public Game(string playerName) + { + player = new Player(playerName); + computer = new Computer(); + } + + // 判断胜负 + private string DetermineWinner(Choice playerChoice, Choice computerChoice) + { + if (playerChoice == computerChoice) + return "平局!"; + + if ((playerChoice == Choice.Scissors && computerChoice == Choice.Paper) || + (playerChoice == Choice.Rock && computerChoice == Choice.Scissors) || + (playerChoice == Choice.Paper && computerChoice == Choice.Rock)) + { + return $"{player.Name} 获胜!"; + } + + return "电脑获胜! "; + } + + // 游戏开始 + public void Start() + { + Console.WriteLine("\n欢迎来到猜拳小游戏!\n"); + + while (true) + { + // 玩家出拳 + Choice playerChoice = player.MakeChoice(); + Console.WriteLine($"{player.Name} 选择了:{playerChoice}"); + + // 电脑出拳 + Choice computerChoice = computer.MakeChoice(); + Console.WriteLine($"电脑选择了:{computerChoice}"); + + // 计算结果 + Console.WriteLine(DetermineWinner(playerChoice, computerChoice)); + + // 询问是否继续 + Console.Write("\n是否继续游戏?(Y/N): "); + string continueGame = Console.ReadLine().Trim().ToUpper(); + + if (continueGame != "Y") + { + Console.WriteLine("游戏结束,谢谢参与!"); + break; + } + } + } + } + + // 主程序 + class Program + { + static void Main() + { + Console.Write("请输入您的名字: "); + string playerName = Console.ReadLine(); + + Game game = new Game(playerName); + game.Start(); + } + } diff --git a/test1-original-code/1.2.txt b/test1-original-code/1.2.txt new file mode 100644 index 00000000..7e2ca401 --- /dev/null +++ b/test1-original-code/1.2.txt @@ -0,0 +1,35 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Swap(ref int n1,ref int n2) + {/*静态方法与实例方法的区别 + 实例方法:属于类的实例(对象),必须通过类的实例来调用。 + 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 + Main方法是静态的,而Swap方法是实例方法。 + 静态方法(如Main)不能直接调用实例方法(如Swap), + 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ + n1 = 10; + n2 = 20; + int exchange_num=0; + exchange_num = n1; + n1 = n2; + n2 = exchange_num; + } + + + static void Main(string[] args)//主方法,程序入口 + { + int n1=0; + int n2=0;//使用ref时必须要先赋值 + Swap(ref n1,ref n2); // 调用方法 + Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 + } + } +} diff --git a/test1-original-code/1.3.txt b/test1-original-code/1.3.txt new file mode 100644 index 00000000..2b99beb8 --- /dev/null +++ b/test1-original-code/1.3.txt @@ -0,0 +1,35 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Swap(out int n1,out int n2) + {/*静态方法与实例方法的区别 + 实例方法:属于类的实例(对象),必须通过类的实例来调用。 + 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 + Main方法是静态的,而Swap方法是实例方法。 + 静态方法(如Main)不能直接调用实例方法(如Swap), + 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ + n1 = 10; + n2 = 20; + int exchange_num=0; + exchange_num = n1; + n1 = n2; + n2 = exchange_num; + } + + + static void Main(string[] args)//主方法,程序入口 + { + int n1; + int n2; + Swap(out n1,out n2); // 调用方法 + Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 + } + } +} diff --git a/test1-original-code/1.4.txt b/test1-original-code/1.4.txt new file mode 100644 index 00000000..188a1950 --- /dev/null +++ b/test1-original-code/1.4.txt @@ -0,0 +1,22 @@ +using System; +class Program +{ + static int MaxValue(params int[] numbers)//最大值函数 + { + int max = numbers[0]; + foreach (int num in numbers) + { + if (num > max) + { + max = num; + } + } + return max; + } + static void Main() + { + Console.WriteLine(MaxValue(3,5,11,27,15,1)); + Console.WriteLine(MaxValue(10,40,1000)); + Console.WriteLine(MaxValue(5,3,4,2,0,1,9)); + } +} diff --git a/test1-original-code/1.5.txt b/test1-original-code/1.5.txt new file mode 100644 index 00000000..786e3aad --- /dev/null +++ b/test1-original-code/1.5.txt @@ -0,0 +1,24 @@ +using System; +class Program +{ + static int FibonacciSum(int n)//斐波那契数列 + { + int a = 0, b = 1, sum = 0; + + for (int i = 1; i <= n; i++) + { + sum += a; + int trans = a + b; + a = b; + b = trans;//用来保存前两个数的数值便于求下一个数 + } + + return sum; + } + static void Main() + { + int n = 20; + long sum = FibonacciSum(n); + Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); + } +} diff --git a/test1-original-code/1.6.txt b/test1-original-code/1.6.txt new file mode 100644 index 00000000..7a8f5ed6 --- /dev/null +++ b/test1-original-code/1.6.txt @@ -0,0 +1,32 @@ +using System; +class Program +{ + static void Main() + { + int rows = 10; // 需要打印的行数 + int[][] triangle = new int[rows][]; // 定义二维数组 + + // 计算杨辉三角形 + for (int i = 0; i < rows; i++) + { + triangle[i] = new int[i + 1]; // 初始化当前行的数组 + triangle[i][0] = triangle[i][i] = 1; // 每行的第一个和最后一个元素是1 + + for (int j = 1; j < i; j++) + { + triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j]; // 中间元素 = 上一行相邻两个数之和 + } + } + + // 打印杨辉三角形 + for (int i = 0; i < rows; i++) + { + Console.Write(new string(' ', (rows - i) * 2)); // 控制对齐(空格) + for (int j = 0; j < triangle[i].Length; j++) + { + Console.Write(triangle[i][j] + " "); // 打印当前元素 + } + Console.WriteLine(); // 换行 + } + } +} diff --git a/test1-original-code/1.7.txt b/test1-original-code/1.7.txt new file mode 100644 index 00000000..e8cec797 --- /dev/null +++ b/test1-original-code/1.7.txt @@ -0,0 +1,55 @@ +using System; +class Program +{ + // 冒泡排序算法 + static void BubbleSort(int[] arr) + { + int n = arr.Length; + bool swapped; // 标记是否发生交换 + + for (int i = 0; i < n - 1; i++) + { + swapped = false; + + for (int j = 0; j < n - 1 - i; j++) + { + if (arr[j] > arr[j + 1]) // 相邻元素比较 + { + Swap(ref arr[j], ref arr[j + 1]); + swapped = true; // 发生交换 + } + } + + // 如果本轮没有发生交换,则说明数组已经有序,提前结束 + if (!swapped) break; + } + } + // 交换两个元素 + static void Swap(ref int a, ref int b) + { + int temp = a; + a = b; + b = temp; + } + // 打印数组 + static void PrintArray(int[] arr) + { + foreach (var item in arr) + { + Console.Write(item + " "); + } + Console.WriteLine(); + } + static void Main() + { + int[] arr = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; + + Console.WriteLine("排序前数组:"); + PrintArray(arr); + + BubbleSort(arr); // 调用冒泡排序 + + Console.WriteLine("\n排序后数组:"); + PrintArray(arr); + } +} diff --git a/test1-original-code/1.8.txt b/test1-original-code/1.8.txt new file mode 100644 index 00000000..c8257a95 --- /dev/null +++ b/test1-original-code/1.8.txt @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; + +class Program +{ + static void Main() + { + string text = "患者:“大夫,我咳嗽得很重。”大夫:“你多大年记?”患者:“七十五岁。”大夫:“二十岁咳嗽吗”患者:“不咳嗽。” 大夫:“四十岁时咳嗽吗?” 患者:“也不咳嗽。” 大夫:“那现在不咳嗽,还要等到什么时咳嗽?”"; + + string target = "咳嗽"; + List indices = FindOccurrences(text, target); + + Console.WriteLine($"“{target}” 出现次数: {indices.Count}"); + Console.WriteLine("出现索引位置:"); + foreach (var index in indices) + { + Console.WriteLine(index); + } + } + + // 查找字符串 target 在 text 中的所有索引 + static List FindOccurrences(string text, string target) + { + List indices = new List(); + int index = text.IndexOf(target); // 第一次出现的位置 + + while (index != -1) + { + indices.Add(index); + index = text.IndexOf(target, index + target.Length); // 从上次索引位置之后继续查找 + } + + return indices; + } +} diff --git a/test1-original-code/1.9.txt b/test1-original-code/1.9.txt new file mode 100644 index 00000000..a506aef5 --- /dev/null +++ b/test1-original-code/1.9.txt @@ -0,0 +1,22 @@ +using System; +class Program +{ + static void Main() + { + string dateStr = "2020年10月1日"; + + // 使用 '年'、'月'、'日' 分割字符串 + string[] parts = dateStr.Split(new char[] { '年', '月', '日' }, StringSplitOptions.RemoveEmptyEntries); + + if (parts.Length == 3) + { + Console.WriteLine($"年: {parts[0]}"); + Console.WriteLine($"月: {parts[1]}"); + Console.WriteLine($"日: {parts[2]}"); + } + else + { + Console.WriteLine("日期格式不正确!"); + } + } +} -- Gitee From 58a31e0da02d793719e53ae94bebdefa4277e9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:11:42 +0000 Subject: [PATCH 02/46] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80=E6=BA=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=811-7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄旻洁 <2955857091@qq.com> --- 1.1/1.1.csproj | 11 ++++++++++ 1.1/program.cs | 24 ++++++++++++++++++++++ 1.2/1.2.csproj | 11 ++++++++++ 1.2/Program.cs | 36 +++++++++++++++++++++++++++++++++ 1.3/1.3.csproj | 11 ++++++++++ 1.3/Program.cs | 35 ++++++++++++++++++++++++++++++++ 1.4/1.4.csproj | 11 ++++++++++ 1.4/Program.cs | 22 ++++++++++++++++++++ 1.5/1.5.csproj | 11 ++++++++++ 1.5/Program.cs | 24 ++++++++++++++++++++++ 1.6/1.6.csproj | 11 ++++++++++ 1.6/Program.cs | 32 +++++++++++++++++++++++++++++ 1.7/1.7.csproj | 11 ++++++++++ 1.7/Program.cs | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 305 insertions(+) create mode 100644 1.1/1.1.csproj create mode 100644 1.1/program.cs create mode 100644 1.2/1.2.csproj create mode 100644 1.2/Program.cs create mode 100644 1.3/1.3.csproj create mode 100644 1.3/Program.cs create mode 100644 1.4/1.4.csproj create mode 100644 1.4/Program.cs create mode 100644 1.5/1.5.csproj create mode 100644 1.5/Program.cs create mode 100644 1.6/1.6.csproj create mode 100644 1.6/Program.cs create mode 100644 1.7/1.7.csproj create mode 100644 1.7/Program.cs diff --git a/1.1/1.1.csproj b/1.1/1.1.csproj new file mode 100644 index 00000000..bd12445c --- /dev/null +++ b/1.1/1.1.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._1 + enable + enable + + + diff --git a/1.1/program.cs b/1.1/program.cs new file mode 100644 index 00000000..299486c6 --- /dev/null +++ b/1.1/program.cs @@ -0,0 +1,24 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Main(string[] args)//主方法,程序入口 + { + int n1 = 10; + int n2 = 20; + int transnum;//用来转换的变量 + + transnum = n1; + n1 = n2; + n2 = transnum; + + Console.WriteLine($"n1 = {n1}, n2 = {n2}"); + } + } +} diff --git a/1.2/1.2.csproj b/1.2/1.2.csproj new file mode 100644 index 00000000..89a52e49 --- /dev/null +++ b/1.2/1.2.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._2 + enable + enable + + + diff --git a/1.2/Program.cs b/1.2/Program.cs new file mode 100644 index 00000000..1e1ca8f2 --- /dev/null +++ b/1.2/Program.cs @@ -0,0 +1,36 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Swap(ref int n1, ref int n2) + {/*静态方法与实例方法的区别 + 实例方法:属于类的实例(对象),必须通过类的实例来调用。 + 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 + Main方法是静态的,而Swap方法是实例方法。 + 静态方法(如Main)不能直接调用实例方法(如Swap), + 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ + n1 = 10; + n2 = 20; + int exchange_num = 0; + exchange_num = n1; + n1 = n2; + n2 = exchange_num; + } + + + static void Main(string[] args)//主方法,程序入口 + { + int n1 = 0; + int n2 = 0;//使用ref时必须要先赋值 + Swap(ref n1, ref n2); // 调用方法 + Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 + } + } +} + diff --git a/1.3/1.3.csproj b/1.3/1.3.csproj new file mode 100644 index 00000000..660fa23a --- /dev/null +++ b/1.3/1.3.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._3 + enable + enable + + + diff --git a/1.3/Program.cs b/1.3/Program.cs new file mode 100644 index 00000000..f847c3a4 --- /dev/null +++ b/1.3/Program.cs @@ -0,0 +1,35 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Swap(out int n1, out int n2) + {/*静态方法与实例方法的区别 + 实例方法:属于类的实例(对象),必须通过类的实例来调用。 + 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 + Main方法是静态的,而Swap方法是实例方法。 + 静态方法(如Main)不能直接调用实例方法(如Swap), + 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ + n1 = 10; + n2 = 20; + int exchange_num = 0; + exchange_num = n1; + n1 = n2; + n2 = exchange_num; + } + + + static void Main(string[] args)//主方法,程序入口 + { + int n1; + int n2; + Swap(out n1, out n2); // 调用方法 + Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 + } + } +} \ No newline at end of file diff --git a/1.4/1.4.csproj b/1.4/1.4.csproj new file mode 100644 index 00000000..1b6f4c01 --- /dev/null +++ b/1.4/1.4.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._4 + enable + enable + + + diff --git a/1.4/Program.cs b/1.4/Program.cs new file mode 100644 index 00000000..a952824a --- /dev/null +++ b/1.4/Program.cs @@ -0,0 +1,22 @@ +using System; +class Program +{ + static int MaxValue(params int[] numbers)//最大值函数 + { + int max = numbers[0]; + foreach (int num in numbers) + { + if (num > max) + { + max = num; + } + } + return max; + } + static void Main() + { + Console.WriteLine(MaxValue(3, 5, 11, 27, 15, 1)); + Console.WriteLine(MaxValue(10, 40, 1000)); + Console.WriteLine(MaxValue(5, 3, 4, 2, 0, 1, 9)); + } +} diff --git a/1.5/1.5.csproj b/1.5/1.5.csproj new file mode 100644 index 00000000..1a078317 --- /dev/null +++ b/1.5/1.5.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._5 + enable + enable + + + diff --git a/1.5/Program.cs b/1.5/Program.cs new file mode 100644 index 00000000..85c0d859 --- /dev/null +++ b/1.5/Program.cs @@ -0,0 +1,24 @@ +using System; +class Program +{ + static int FibonacciSum(int n)//斐波那契数列 + { + int a = 0, b = 1, sum = 0; + + for (int i = 1; i <= n; i++) + { + sum += a; + int trans = a + b; + a = b; + b = trans;//用来保存前两个数的数值便于求下一个数 + } + + return sum; + } + static void Main() + { + int n = 20; + long sum = FibonacciSum(n); + Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); + } +} diff --git a/1.6/1.6.csproj b/1.6/1.6.csproj new file mode 100644 index 00000000..4c1bf4bd --- /dev/null +++ b/1.6/1.6.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._6 + enable + enable + + + diff --git a/1.6/Program.cs b/1.6/Program.cs new file mode 100644 index 00000000..0d1f328a --- /dev/null +++ b/1.6/Program.cs @@ -0,0 +1,32 @@ +using System; +class Program +{ + static void Main() + { + int rows = 10; // 需要打印的行数 + int[][] triangle = new int[rows][]; // 定义二维数组 + + // 计算杨辉三角形 + for (int i = 0; i < rows; i++) + { + triangle[i] = new int[i + 1]; // 初始化当前行的数组 + triangle[i][0] = triangle[i][i] = 1; // 每行的第一个和最后一个元素是1 + + for (int j = 1; j < i; j++) + { + triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j]; // 中间元素 = 上一行相邻两个数之和 + } + } + + // 打印杨辉三角形 + for (int i = 0; i < rows; i++) + { + Console.Write(new string(' ', (rows - i) * 2)); // 控制对齐(空格) + for (int j = 0; j < triangle[i].Length; j++) + { + Console.Write(triangle[i][j] + " "); // 打印当前元素 + } + Console.WriteLine(); // 换行 + } + } +} \ No newline at end of file diff --git a/1.7/1.7.csproj b/1.7/1.7.csproj new file mode 100644 index 00000000..5781c455 --- /dev/null +++ b/1.7/1.7.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._7 + enable + enable + + + diff --git a/1.7/Program.cs b/1.7/Program.cs new file mode 100644 index 00000000..654c048e --- /dev/null +++ b/1.7/Program.cs @@ -0,0 +1,55 @@ +using System; +class Program +{ + // 冒泡排序算法 + static void BubbleSort(int[] arr) + { + int n = arr.Length; + bool swapped; // 标记是否发生交换 + + for (int i = 0; i < n - 1; i++) + { + swapped = false; + + for (int j = 0; j < n - 1 - i; j++) + { + if (arr[j] > arr[j + 1]) // 相邻元素比较 + { + Swap(ref arr[j], ref arr[j + 1]); + swapped = true; // 发生交换 + } + } + + // 如果本轮没有发生交换,则说明数组已经有序,提前结束 + if (!swapped) break; + } + } + // 交换两个元素 + static void Swap(ref int a, ref int b) + { + int temp = a; + a = b; + b = temp; + } + // 打印数组 + static void PrintArray(int[] arr) + { + foreach (var item in arr) + { + Console.Write(item + " "); + } + Console.WriteLine(); + } + static void Main() + { + int[] arr = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; + + Console.WriteLine("排序前数组:"); + PrintArray(arr); + + BubbleSort(arr); // 调用冒泡排序 + + Console.WriteLine("\n排序后数组:"); + PrintArray(arr); + } +} -- Gitee From 644fa91a7c2557c3057ad5c04c435a9e32be03e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:13 +0000 Subject: [PATCH 03/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.1/1.1.csproj | 11 ----------- 1.1/program.cs | 24 ------------------------ 2 files changed, 35 deletions(-) delete mode 100644 1.1/1.1.csproj delete mode 100644 1.1/program.cs diff --git a/1.1/1.1.csproj b/1.1/1.1.csproj deleted file mode 100644 index bd12445c..00000000 --- a/1.1/1.1.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._1 - enable - enable - - - diff --git a/1.1/program.cs b/1.1/program.cs deleted file mode 100644 index 299486c6..00000000 --- a/1.1/program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System;//引入命名空间 -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _1.cs//定义命名空间 -{ - class Program//定义类 - { - static void Main(string[] args)//主方法,程序入口 - { - int n1 = 10; - int n2 = 20; - int transnum;//用来转换的变量 - - transnum = n1; - n1 = n2; - n2 = transnum; - - Console.WriteLine($"n1 = {n1}, n2 = {n2}"); - } - } -} -- Gitee From 35bc11f2176cc82b7d4e5c9e7aaac24c638def3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:20 +0000 Subject: [PATCH 04/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.2/1.2.csproj | 11 ----------- 1.2/Program.cs | 36 ------------------------------------ 2 files changed, 47 deletions(-) delete mode 100644 1.2/1.2.csproj delete mode 100644 1.2/Program.cs diff --git a/1.2/1.2.csproj b/1.2/1.2.csproj deleted file mode 100644 index 89a52e49..00000000 --- a/1.2/1.2.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._2 - enable - enable - - - diff --git a/1.2/Program.cs b/1.2/Program.cs deleted file mode 100644 index 1e1ca8f2..00000000 --- a/1.2/Program.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System;//引入命名空间 -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _1.cs//定义命名空间 -{ - class Program//定义类 - { - static void Swap(ref int n1, ref int n2) - {/*静态方法与实例方法的区别 - 实例方法:属于类的实例(对象),必须通过类的实例来调用。 - 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 - Main方法是静态的,而Swap方法是实例方法。 - 静态方法(如Main)不能直接调用实例方法(如Swap), - 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ - n1 = 10; - n2 = 20; - int exchange_num = 0; - exchange_num = n1; - n1 = n2; - n2 = exchange_num; - } - - - static void Main(string[] args)//主方法,程序入口 - { - int n1 = 0; - int n2 = 0;//使用ref时必须要先赋值 - Swap(ref n1, ref n2); // 调用方法 - Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 - } - } -} - -- Gitee From 99ad205636ad0c7afa7871a13710b460b31177bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:27 +0000 Subject: [PATCH 05/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.3/1.3.csproj | 11 ----------- 1.3/Program.cs | 35 ----------------------------------- 2 files changed, 46 deletions(-) delete mode 100644 1.3/1.3.csproj delete mode 100644 1.3/Program.cs diff --git a/1.3/1.3.csproj b/1.3/1.3.csproj deleted file mode 100644 index 660fa23a..00000000 --- a/1.3/1.3.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._3 - enable - enable - - - diff --git a/1.3/Program.cs b/1.3/Program.cs deleted file mode 100644 index f847c3a4..00000000 --- a/1.3/Program.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System;//引入命名空间 -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _1.cs//定义命名空间 -{ - class Program//定义类 - { - static void Swap(out int n1, out int n2) - {/*静态方法与实例方法的区别 - 实例方法:属于类的实例(对象),必须通过类的实例来调用。 - 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 - Main方法是静态的,而Swap方法是实例方法。 - 静态方法(如Main)不能直接调用实例方法(如Swap), - 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ - n1 = 10; - n2 = 20; - int exchange_num = 0; - exchange_num = n1; - n1 = n2; - n2 = exchange_num; - } - - - static void Main(string[] args)//主方法,程序入口 - { - int n1; - int n2; - Swap(out n1, out n2); // 调用方法 - Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 - } - } -} \ No newline at end of file -- Gitee From 6574cfe7d9d43b9f29ed6fce30a65d21c03ddd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:33 +0000 Subject: [PATCH 06/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.4/1.4.csproj | 11 ----------- 1.4/Program.cs | 22 ---------------------- 2 files changed, 33 deletions(-) delete mode 100644 1.4/1.4.csproj delete mode 100644 1.4/Program.cs diff --git a/1.4/1.4.csproj b/1.4/1.4.csproj deleted file mode 100644 index 1b6f4c01..00000000 --- a/1.4/1.4.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._4 - enable - enable - - - diff --git a/1.4/Program.cs b/1.4/Program.cs deleted file mode 100644 index a952824a..00000000 --- a/1.4/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -class Program -{ - static int MaxValue(params int[] numbers)//最大值函数 - { - int max = numbers[0]; - foreach (int num in numbers) - { - if (num > max) - { - max = num; - } - } - return max; - } - static void Main() - { - Console.WriteLine(MaxValue(3, 5, 11, 27, 15, 1)); - Console.WriteLine(MaxValue(10, 40, 1000)); - Console.WriteLine(MaxValue(5, 3, 4, 2, 0, 1, 9)); - } -} -- Gitee From 871bd51e6cf6514623525da521100417043cdc36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:39 +0000 Subject: [PATCH 07/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.5/1.5.csproj | 11 ----------- 1.5/Program.cs | 24 ------------------------ 2 files changed, 35 deletions(-) delete mode 100644 1.5/1.5.csproj delete mode 100644 1.5/Program.cs diff --git a/1.5/1.5.csproj b/1.5/1.5.csproj deleted file mode 100644 index 1a078317..00000000 --- a/1.5/1.5.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._5 - enable - enable - - - diff --git a/1.5/Program.cs b/1.5/Program.cs deleted file mode 100644 index 85c0d859..00000000 --- a/1.5/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -class Program -{ - static int FibonacciSum(int n)//斐波那契数列 - { - int a = 0, b = 1, sum = 0; - - for (int i = 1; i <= n; i++) - { - sum += a; - int trans = a + b; - a = b; - b = trans;//用来保存前两个数的数值便于求下一个数 - } - - return sum; - } - static void Main() - { - int n = 20; - long sum = FibonacciSum(n); - Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); - } -} -- Gitee From 69f7779025d4da6b079c4bf67103667bd878e591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:46 +0000 Subject: [PATCH 08/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.6/1.6.csproj | 11 ----------- 1.6/Program.cs | 32 -------------------------------- 2 files changed, 43 deletions(-) delete mode 100644 1.6/1.6.csproj delete mode 100644 1.6/Program.cs diff --git a/1.6/1.6.csproj b/1.6/1.6.csproj deleted file mode 100644 index 4c1bf4bd..00000000 --- a/1.6/1.6.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._6 - enable - enable - - - diff --git a/1.6/Program.cs b/1.6/Program.cs deleted file mode 100644 index 0d1f328a..00000000 --- a/1.6/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -class Program -{ - static void Main() - { - int rows = 10; // 需要打印的行数 - int[][] triangle = new int[rows][]; // 定义二维数组 - - // 计算杨辉三角形 - for (int i = 0; i < rows; i++) - { - triangle[i] = new int[i + 1]; // 初始化当前行的数组 - triangle[i][0] = triangle[i][i] = 1; // 每行的第一个和最后一个元素是1 - - for (int j = 1; j < i; j++) - { - triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j]; // 中间元素 = 上一行相邻两个数之和 - } - } - - // 打印杨辉三角形 - for (int i = 0; i < rows; i++) - { - Console.Write(new string(' ', (rows - i) * 2)); // 控制对齐(空格) - for (int j = 0; j < triangle[i].Length; j++) - { - Console.Write(triangle[i][j] + " "); // 打印当前元素 - } - Console.WriteLine(); // 换行 - } - } -} \ No newline at end of file -- Gitee From 459e70670452dbc52659e90d4bd539f04fdb44a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:12:52 +0000 Subject: [PATCH 09/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=201.?= =?UTF-8?q?7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.7/1.7.csproj | 11 ---------- 1.7/Program.cs | 55 -------------------------------------------------- 2 files changed, 66 deletions(-) delete mode 100644 1.7/1.7.csproj delete mode 100644 1.7/Program.cs diff --git a/1.7/1.7.csproj b/1.7/1.7.csproj deleted file mode 100644 index 5781c455..00000000 --- a/1.7/1.7.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net8.0 - _1._7 - enable - enable - - - diff --git a/1.7/Program.cs b/1.7/Program.cs deleted file mode 100644 index 654c048e..00000000 --- a/1.7/Program.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -class Program -{ - // 冒泡排序算法 - static void BubbleSort(int[] arr) - { - int n = arr.Length; - bool swapped; // 标记是否发生交换 - - for (int i = 0; i < n - 1; i++) - { - swapped = false; - - for (int j = 0; j < n - 1 - i; j++) - { - if (arr[j] > arr[j + 1]) // 相邻元素比较 - { - Swap(ref arr[j], ref arr[j + 1]); - swapped = true; // 发生交换 - } - } - - // 如果本轮没有发生交换,则说明数组已经有序,提前结束 - if (!swapped) break; - } - } - // 交换两个元素 - static void Swap(ref int a, ref int b) - { - int temp = a; - a = b; - b = temp; - } - // 打印数组 - static void PrintArray(int[] arr) - { - foreach (var item in arr) - { - Console.Write(item + " "); - } - Console.WriteLine(); - } - static void Main() - { - int[] arr = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; - - Console.WriteLine("排序前数组:"); - PrintArray(arr); - - BubbleSort(arr); // 调用冒泡排序 - - Console.WriteLine("\n排序后数组:"); - PrintArray(arr); - } -} -- Gitee From 4689ee9f4bbe75da2207379597b9c7b7bce46995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:13:06 +0000 Subject: [PATCH 10/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.1.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.1.txt | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 test1-original-code/1.1.txt diff --git a/test1-original-code/1.1.txt b/test1-original-code/1.1.txt deleted file mode 100644 index f59d00ca..00000000 --- a/test1-original-code/1.1.txt +++ /dev/null @@ -1,24 +0,0 @@ -using System;//引入命名空间 -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _1.cs//定义命名空间 -{ - class Program//定义类 - { - static void Main(string[] args)//主方法,程序入口 - { - int n1 = 10; - int n2 = 20; - int transnum;//用来转换的变量 - - transnum = n1; - n1 = n2; - n2 = transnum; - - Console.WriteLine($"n1 = {n1}, n2 = {n2}"); - } - } -} -- Gitee From 08020e7b7124ddf0f5e5d0cf234d638b00efa232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:13:11 +0000 Subject: [PATCH 11/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.10.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.10.txt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 test1-original-code/1.10.txt diff --git a/test1-original-code/1.10.txt b/test1-original-code/1.10.txt deleted file mode 100644 index 71be8a7b..00000000 --- a/test1-original-code/1.10.txt +++ /dev/null @@ -1,13 +0,0 @@ -using System; -class Program -{ - static void Main() - { - string input = " Hello World ! 你好 世界 ! "; - - // 先去掉首尾空格 -> 按空格分割(去掉多余空格)-> 用单个空格拼接 - string result = string.Join(" ", input.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)); - - Console.WriteLine($"处理后字符串: \"{result}\""); - } -} -- Gitee From 122b7724d2dc59491e9af3d2b4751991261dcc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:13:16 +0000 Subject: [PATCH 12/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.11.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.11.txt | 122 ----------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 test1-original-code/1.11.txt diff --git a/test1-original-code/1.11.txt b/test1-original-code/1.11.txt deleted file mode 100644 index 79048948..00000000 --- a/test1-original-code/1.11.txt +++ /dev/null @@ -1,122 +0,0 @@ -using System; - -namespace RockPaperScissors -{ - // 枚举定义游戏选项 - public enum Choice - { - Scissors = 1, // 剪刀 - Rock = 2, // 石头 - Paper = 3 // 布 - } - - // 玩家类 - class Player - { - public string Name { get; set; } - - public Player(string name) - { - Name = name; - } - - // 玩家选择出拳 - public Choice MakeChoice() - { - while (true) - { - Console.Write("请选择:1. 剪刀 2. 石头 3. 布 :"); - string input = Console.ReadLine(); - - if (int.TryParse(input, out int choice) && choice >= 1 && choice <= 3) - { - return (Choice)choice; - } - Console.WriteLine("输入无效,请输入 1-3 之间的数字!"); - } - } - } - - // 电脑类 - class Computer - { - private static readonly Random random = new Random(); - - // 电脑随机出拳 - public Choice MakeChoice() - { - return (Choice)random.Next(1, 4); - } - } - - // 游戏逻辑类 - class Game - { - private Player player; - private Computer computer; - - public Game(string playerName) - { - player = new Player(playerName); - computer = new Computer(); - } - - // 判断胜负 - private string DetermineWinner(Choice playerChoice, Choice computerChoice) - { - if (playerChoice == computerChoice) - return "平局!"; - - if ((playerChoice == Choice.Scissors && computerChoice == Choice.Paper) || - (playerChoice == Choice.Rock && computerChoice == Choice.Scissors) || - (playerChoice == Choice.Paper && computerChoice == Choice.Rock)) - { - return $"{player.Name} 获胜!"; - } - - return "电脑获胜! "; - } - - // 游戏开始 - public void Start() - { - Console.WriteLine("\n欢迎来到猜拳小游戏!\n"); - - while (true) - { - // 玩家出拳 - Choice playerChoice = player.MakeChoice(); - Console.WriteLine($"{player.Name} 选择了:{playerChoice}"); - - // 电脑出拳 - Choice computerChoice = computer.MakeChoice(); - Console.WriteLine($"电脑选择了:{computerChoice}"); - - // 计算结果 - Console.WriteLine(DetermineWinner(playerChoice, computerChoice)); - - // 询问是否继续 - Console.Write("\n是否继续游戏?(Y/N): "); - string continueGame = Console.ReadLine().Trim().ToUpper(); - - if (continueGame != "Y") - { - Console.WriteLine("游戏结束,谢谢参与!"); - break; - } - } - } - } - - // 主程序 - class Program - { - static void Main() - { - Console.Write("请输入您的名字: "); - string playerName = Console.ReadLine(); - - Game game = new Game(playerName); - game.Start(); - } - } -- Gitee From 8b93c86f171835e85ec5e374b75c29e00c999188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:13:24 +0000 Subject: [PATCH 13/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.2.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.2.txt | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 test1-original-code/1.2.txt diff --git a/test1-original-code/1.2.txt b/test1-original-code/1.2.txt deleted file mode 100644 index 7e2ca401..00000000 --- a/test1-original-code/1.2.txt +++ /dev/null @@ -1,35 +0,0 @@ -using System;//引入命名空间 -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _1.cs//定义命名空间 -{ - class Program//定义类 - { - static void Swap(ref int n1,ref int n2) - {/*静态方法与实例方法的区别 - 实例方法:属于类的实例(对象),必须通过类的实例来调用。 - 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 - Main方法是静态的,而Swap方法是实例方法。 - 静态方法(如Main)不能直接调用实例方法(如Swap), - 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ - n1 = 10; - n2 = 20; - int exchange_num=0; - exchange_num = n1; - n1 = n2; - n2 = exchange_num; - } - - - static void Main(string[] args)//主方法,程序入口 - { - int n1=0; - int n2=0;//使用ref时必须要先赋值 - Swap(ref n1,ref n2); // 调用方法 - Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 - } - } -} -- Gitee From a3744c191aed9c972bc1e08e583759a3afffc64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:13:36 +0000 Subject: [PATCH 14/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.3.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.3.txt | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 test1-original-code/1.3.txt diff --git a/test1-original-code/1.3.txt b/test1-original-code/1.3.txt deleted file mode 100644 index 2b99beb8..00000000 --- a/test1-original-code/1.3.txt +++ /dev/null @@ -1,35 +0,0 @@ -using System;//引入命名空间 -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _1.cs//定义命名空间 -{ - class Program//定义类 - { - static void Swap(out int n1,out int n2) - {/*静态方法与实例方法的区别 - 实例方法:属于类的实例(对象),必须通过类的实例来调用。 - 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 - Main方法是静态的,而Swap方法是实例方法。 - 静态方法(如Main)不能直接调用实例方法(如Swap), - 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ - n1 = 10; - n2 = 20; - int exchange_num=0; - exchange_num = n1; - n1 = n2; - n2 = exchange_num; - } - - - static void Main(string[] args)//主方法,程序入口 - { - int n1; - int n2; - Swap(out n1,out n2); // 调用方法 - Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 - } - } -} -- Gitee From 4d58a5e98b1329fb42e7f51c88f7800c1fd09d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:13:47 +0000 Subject: [PATCH 15/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.4.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.4.txt | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 test1-original-code/1.4.txt diff --git a/test1-original-code/1.4.txt b/test1-original-code/1.4.txt deleted file mode 100644 index 188a1950..00000000 --- a/test1-original-code/1.4.txt +++ /dev/null @@ -1,22 +0,0 @@ -using System; -class Program -{ - static int MaxValue(params int[] numbers)//最大值函数 - { - int max = numbers[0]; - foreach (int num in numbers) - { - if (num > max) - { - max = num; - } - } - return max; - } - static void Main() - { - Console.WriteLine(MaxValue(3,5,11,27,15,1)); - Console.WriteLine(MaxValue(10,40,1000)); - Console.WriteLine(MaxValue(5,3,4,2,0,1,9)); - } -} -- Gitee From 1b2faf49a764e7312912d5bb441d3356bbeeb3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:14:10 +0000 Subject: [PATCH 16/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.5.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.5.txt | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 test1-original-code/1.5.txt diff --git a/test1-original-code/1.5.txt b/test1-original-code/1.5.txt deleted file mode 100644 index 786e3aad..00000000 --- a/test1-original-code/1.5.txt +++ /dev/null @@ -1,24 +0,0 @@ -using System; -class Program -{ - static int FibonacciSum(int n)//斐波那契数列 - { - int a = 0, b = 1, sum = 0; - - for (int i = 1; i <= n; i++) - { - sum += a; - int trans = a + b; - a = b; - b = trans;//用来保存前两个数的数值便于求下一个数 - } - - return sum; - } - static void Main() - { - int n = 20; - long sum = FibonacciSum(n); - Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); - } -} -- Gitee From 5d2c6cce2e4bcd23ea514a78bb0b924b94fc7691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:14:16 +0000 Subject: [PATCH 17/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.6.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.6.txt | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 test1-original-code/1.6.txt diff --git a/test1-original-code/1.6.txt b/test1-original-code/1.6.txt deleted file mode 100644 index 7a8f5ed6..00000000 --- a/test1-original-code/1.6.txt +++ /dev/null @@ -1,32 +0,0 @@ -using System; -class Program -{ - static void Main() - { - int rows = 10; // 需要打印的行数 - int[][] triangle = new int[rows][]; // 定义二维数组 - - // 计算杨辉三角形 - for (int i = 0; i < rows; i++) - { - triangle[i] = new int[i + 1]; // 初始化当前行的数组 - triangle[i][0] = triangle[i][i] = 1; // 每行的第一个和最后一个元素是1 - - for (int j = 1; j < i; j++) - { - triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j]; // 中间元素 = 上一行相邻两个数之和 - } - } - - // 打印杨辉三角形 - for (int i = 0; i < rows; i++) - { - Console.Write(new string(' ', (rows - i) * 2)); // 控制对齐(空格) - for (int j = 0; j < triangle[i].Length; j++) - { - Console.Write(triangle[i][j] + " "); // 打印当前元素 - } - Console.WriteLine(); // 换行 - } - } -} -- Gitee From 7a1abdde03ae236fd1e97faf539b3cfc4f7dee74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:14:23 +0000 Subject: [PATCH 18/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.7.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.7.txt | 55 ------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 test1-original-code/1.7.txt diff --git a/test1-original-code/1.7.txt b/test1-original-code/1.7.txt deleted file mode 100644 index e8cec797..00000000 --- a/test1-original-code/1.7.txt +++ /dev/null @@ -1,55 +0,0 @@ -using System; -class Program -{ - // 冒泡排序算法 - static void BubbleSort(int[] arr) - { - int n = arr.Length; - bool swapped; // 标记是否发生交换 - - for (int i = 0; i < n - 1; i++) - { - swapped = false; - - for (int j = 0; j < n - 1 - i; j++) - { - if (arr[j] > arr[j + 1]) // 相邻元素比较 - { - Swap(ref arr[j], ref arr[j + 1]); - swapped = true; // 发生交换 - } - } - - // 如果本轮没有发生交换,则说明数组已经有序,提前结束 - if (!swapped) break; - } - } - // 交换两个元素 - static void Swap(ref int a, ref int b) - { - int temp = a; - a = b; - b = temp; - } - // 打印数组 - static void PrintArray(int[] arr) - { - foreach (var item in arr) - { - Console.Write(item + " "); - } - Console.WriteLine(); - } - static void Main() - { - int[] arr = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; - - Console.WriteLine("排序前数组:"); - PrintArray(arr); - - BubbleSort(arr); // 调用冒泡排序 - - Console.WriteLine("\n排序后数组:"); - PrintArray(arr); - } -} -- Gitee From 7005520e9efcc14006a9e672f0954975a727cf3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:14:28 +0000 Subject: [PATCH 19/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.8.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.8.txt | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 test1-original-code/1.8.txt diff --git a/test1-original-code/1.8.txt b/test1-original-code/1.8.txt deleted file mode 100644 index c8257a95..00000000 --- a/test1-original-code/1.8.txt +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; - -class Program -{ - static void Main() - { - string text = "患者:“大夫,我咳嗽得很重。”大夫:“你多大年记?”患者:“七十五岁。”大夫:“二十岁咳嗽吗”患者:“不咳嗽。” 大夫:“四十岁时咳嗽吗?” 患者:“也不咳嗽。” 大夫:“那现在不咳嗽,还要等到什么时咳嗽?”"; - - string target = "咳嗽"; - List indices = FindOccurrences(text, target); - - Console.WriteLine($"“{target}” 出现次数: {indices.Count}"); - Console.WriteLine("出现索引位置:"); - foreach (var index in indices) - { - Console.WriteLine(index); - } - } - - // 查找字符串 target 在 text 中的所有索引 - static List FindOccurrences(string text, string target) - { - List indices = new List(); - int index = text.IndexOf(target); // 第一次出现的位置 - - while (index != -1) - { - indices.Add(index); - index = text.IndexOf(target, index + target.Length); // 从上次索引位置之后继续查找 - } - - return indices; - } -} -- Gitee From d490f409e2b64f0666222b847072686faf9a7e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:15:40 +0000 Subject: [PATCH 20/46] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80=E6=BA=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=811-7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄旻洁 <2955857091@qq.com> --- test1-original-code/1.1/1.1.csproj | 11 ++++++ test1-original-code/1.1/program.cs | 24 +++++++++++++ test1-original-code/1.2/1.2.csproj | 11 ++++++ test1-original-code/1.2/Program.cs | 36 +++++++++++++++++++ test1-original-code/1.3/1.3.csproj | 11 ++++++ test1-original-code/1.3/Program.cs | 35 +++++++++++++++++++ test1-original-code/1.4/1.4.csproj | 11 ++++++ test1-original-code/1.4/Program.cs | 22 ++++++++++++ test1-original-code/1.5/1.5.csproj | 11 ++++++ test1-original-code/1.5/Program.cs | 24 +++++++++++++ test1-original-code/1.6/1.6.csproj | 11 ++++++ test1-original-code/1.6/Program.cs | 32 +++++++++++++++++ test1-original-code/1.7/1.7.csproj | 11 ++++++ test1-original-code/1.7/Program.cs | 55 ++++++++++++++++++++++++++++++ 14 files changed, 305 insertions(+) create mode 100644 test1-original-code/1.1/1.1.csproj create mode 100644 test1-original-code/1.1/program.cs create mode 100644 test1-original-code/1.2/1.2.csproj create mode 100644 test1-original-code/1.2/Program.cs create mode 100644 test1-original-code/1.3/1.3.csproj create mode 100644 test1-original-code/1.3/Program.cs create mode 100644 test1-original-code/1.4/1.4.csproj create mode 100644 test1-original-code/1.4/Program.cs create mode 100644 test1-original-code/1.5/1.5.csproj create mode 100644 test1-original-code/1.5/Program.cs create mode 100644 test1-original-code/1.6/1.6.csproj create mode 100644 test1-original-code/1.6/Program.cs create mode 100644 test1-original-code/1.7/1.7.csproj create mode 100644 test1-original-code/1.7/Program.cs diff --git a/test1-original-code/1.1/1.1.csproj b/test1-original-code/1.1/1.1.csproj new file mode 100644 index 00000000..bd12445c --- /dev/null +++ b/test1-original-code/1.1/1.1.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._1 + enable + enable + + + diff --git a/test1-original-code/1.1/program.cs b/test1-original-code/1.1/program.cs new file mode 100644 index 00000000..299486c6 --- /dev/null +++ b/test1-original-code/1.1/program.cs @@ -0,0 +1,24 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Main(string[] args)//主方法,程序入口 + { + int n1 = 10; + int n2 = 20; + int transnum;//用来转换的变量 + + transnum = n1; + n1 = n2; + n2 = transnum; + + Console.WriteLine($"n1 = {n1}, n2 = {n2}"); + } + } +} diff --git a/test1-original-code/1.2/1.2.csproj b/test1-original-code/1.2/1.2.csproj new file mode 100644 index 00000000..89a52e49 --- /dev/null +++ b/test1-original-code/1.2/1.2.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._2 + enable + enable + + + diff --git a/test1-original-code/1.2/Program.cs b/test1-original-code/1.2/Program.cs new file mode 100644 index 00000000..1e1ca8f2 --- /dev/null +++ b/test1-original-code/1.2/Program.cs @@ -0,0 +1,36 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Swap(ref int n1, ref int n2) + {/*静态方法与实例方法的区别 + 实例方法:属于类的实例(对象),必须通过类的实例来调用。 + 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 + Main方法是静态的,而Swap方法是实例方法。 + 静态方法(如Main)不能直接调用实例方法(如Swap), + 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ + n1 = 10; + n2 = 20; + int exchange_num = 0; + exchange_num = n1; + n1 = n2; + n2 = exchange_num; + } + + + static void Main(string[] args)//主方法,程序入口 + { + int n1 = 0; + int n2 = 0;//使用ref时必须要先赋值 + Swap(ref n1, ref n2); // 调用方法 + Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 + } + } +} + diff --git a/test1-original-code/1.3/1.3.csproj b/test1-original-code/1.3/1.3.csproj new file mode 100644 index 00000000..660fa23a --- /dev/null +++ b/test1-original-code/1.3/1.3.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._3 + enable + enable + + + diff --git a/test1-original-code/1.3/Program.cs b/test1-original-code/1.3/Program.cs new file mode 100644 index 00000000..f847c3a4 --- /dev/null +++ b/test1-original-code/1.3/Program.cs @@ -0,0 +1,35 @@ +using System;//引入命名空间 +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _1.cs//定义命名空间 +{ + class Program//定义类 + { + static void Swap(out int n1, out int n2) + {/*静态方法与实例方法的区别 + 实例方法:属于类的实例(对象),必须通过类的实例来调用。 + 静态方法:属于类本身,而不是类的实例,可以直接通过类名调用。 + Main方法是静态的,而Swap方法是实例方法。 + 静态方法(如Main)不能直接调用实例方法(如Swap), + 因为实例方法依赖于类的实例(对象),而静态方法不依赖于任何实例。*/ + n1 = 10; + n2 = 20; + int exchange_num = 0; + exchange_num = n1; + n1 = n2; + n2 = exchange_num; + } + + + static void Main(string[] args)//主方法,程序入口 + { + int n1; + int n2; + Swap(out n1, out n2); // 调用方法 + Console.WriteLine($"n1: {n1}, n2: {n2}"); // 输出 + } + } +} \ No newline at end of file diff --git a/test1-original-code/1.4/1.4.csproj b/test1-original-code/1.4/1.4.csproj new file mode 100644 index 00000000..1b6f4c01 --- /dev/null +++ b/test1-original-code/1.4/1.4.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._4 + enable + enable + + + diff --git a/test1-original-code/1.4/Program.cs b/test1-original-code/1.4/Program.cs new file mode 100644 index 00000000..a952824a --- /dev/null +++ b/test1-original-code/1.4/Program.cs @@ -0,0 +1,22 @@ +using System; +class Program +{ + static int MaxValue(params int[] numbers)//最大值函数 + { + int max = numbers[0]; + foreach (int num in numbers) + { + if (num > max) + { + max = num; + } + } + return max; + } + static void Main() + { + Console.WriteLine(MaxValue(3, 5, 11, 27, 15, 1)); + Console.WriteLine(MaxValue(10, 40, 1000)); + Console.WriteLine(MaxValue(5, 3, 4, 2, 0, 1, 9)); + } +} diff --git a/test1-original-code/1.5/1.5.csproj b/test1-original-code/1.5/1.5.csproj new file mode 100644 index 00000000..1a078317 --- /dev/null +++ b/test1-original-code/1.5/1.5.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._5 + enable + enable + + + diff --git a/test1-original-code/1.5/Program.cs b/test1-original-code/1.5/Program.cs new file mode 100644 index 00000000..85c0d859 --- /dev/null +++ b/test1-original-code/1.5/Program.cs @@ -0,0 +1,24 @@ +using System; +class Program +{ + static int FibonacciSum(int n)//斐波那契数列 + { + int a = 0, b = 1, sum = 0; + + for (int i = 1; i <= n; i++) + { + sum += a; + int trans = a + b; + a = b; + b = trans;//用来保存前两个数的数值便于求下一个数 + } + + return sum; + } + static void Main() + { + int n = 20; + long sum = FibonacciSum(n); + Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); + } +} diff --git a/test1-original-code/1.6/1.6.csproj b/test1-original-code/1.6/1.6.csproj new file mode 100644 index 00000000..4c1bf4bd --- /dev/null +++ b/test1-original-code/1.6/1.6.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._6 + enable + enable + + + diff --git a/test1-original-code/1.6/Program.cs b/test1-original-code/1.6/Program.cs new file mode 100644 index 00000000..0d1f328a --- /dev/null +++ b/test1-original-code/1.6/Program.cs @@ -0,0 +1,32 @@ +using System; +class Program +{ + static void Main() + { + int rows = 10; // 需要打印的行数 + int[][] triangle = new int[rows][]; // 定义二维数组 + + // 计算杨辉三角形 + for (int i = 0; i < rows; i++) + { + triangle[i] = new int[i + 1]; // 初始化当前行的数组 + triangle[i][0] = triangle[i][i] = 1; // 每行的第一个和最后一个元素是1 + + for (int j = 1; j < i; j++) + { + triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j]; // 中间元素 = 上一行相邻两个数之和 + } + } + + // 打印杨辉三角形 + for (int i = 0; i < rows; i++) + { + Console.Write(new string(' ', (rows - i) * 2)); // 控制对齐(空格) + for (int j = 0; j < triangle[i].Length; j++) + { + Console.Write(triangle[i][j] + " "); // 打印当前元素 + } + Console.WriteLine(); // 换行 + } + } +} \ No newline at end of file diff --git a/test1-original-code/1.7/1.7.csproj b/test1-original-code/1.7/1.7.csproj new file mode 100644 index 00000000..5781c455 --- /dev/null +++ b/test1-original-code/1.7/1.7.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._7 + enable + enable + + + diff --git a/test1-original-code/1.7/Program.cs b/test1-original-code/1.7/Program.cs new file mode 100644 index 00000000..654c048e --- /dev/null +++ b/test1-original-code/1.7/Program.cs @@ -0,0 +1,55 @@ +using System; +class Program +{ + // 冒泡排序算法 + static void BubbleSort(int[] arr) + { + int n = arr.Length; + bool swapped; // 标记是否发生交换 + + for (int i = 0; i < n - 1; i++) + { + swapped = false; + + for (int j = 0; j < n - 1 - i; j++) + { + if (arr[j] > arr[j + 1]) // 相邻元素比较 + { + Swap(ref arr[j], ref arr[j + 1]); + swapped = true; // 发生交换 + } + } + + // 如果本轮没有发生交换,则说明数组已经有序,提前结束 + if (!swapped) break; + } + } + // 交换两个元素 + static void Swap(ref int a, ref int b) + { + int temp = a; + a = b; + b = temp; + } + // 打印数组 + static void PrintArray(int[] arr) + { + foreach (var item in arr) + { + Console.Write(item + " "); + } + Console.WriteLine(); + } + static void Main() + { + int[] arr = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; + + Console.WriteLine("排序前数组:"); + PrintArray(arr); + + BubbleSort(arr); // 调用冒泡排序 + + Console.WriteLine("\n排序后数组:"); + PrintArray(arr); + } +} -- Gitee From 6833ce50dd6ffbb982e6e8f8ce912fd490b05cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:16:06 +0000 Subject: [PATCH 21/46] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80=E6=BA=90?= =?UTF-8?q?=E4=BB=A3=E7=A0=819-11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄旻洁 <2955857091@qq.com> --- test1-original-code/1.10/1.10.csproj | 11 +++ test1-original-code/1.10/Program.cs | 13 +++ test1-original-code/1.11/1.11.csproj | 11 +++ test1-original-code/1.11/Program.cs | 122 +++++++++++++++++++++++++++ test1-original-code/1.8/1.8.csproj | 11 +++ test1-original-code/1.8/Program.cs | 36 ++++++++ test1-original-code/1.9/1.9.csproj | 11 +++ test1-original-code/1.9/Program.cs | 22 +++++ 8 files changed, 237 insertions(+) create mode 100644 test1-original-code/1.10/1.10.csproj create mode 100644 test1-original-code/1.10/Program.cs create mode 100644 test1-original-code/1.11/1.11.csproj create mode 100644 test1-original-code/1.11/Program.cs create mode 100644 test1-original-code/1.8/1.8.csproj create mode 100644 test1-original-code/1.8/Program.cs create mode 100644 test1-original-code/1.9/1.9.csproj create mode 100644 test1-original-code/1.9/Program.cs diff --git a/test1-original-code/1.10/1.10.csproj b/test1-original-code/1.10/1.10.csproj new file mode 100644 index 00000000..e1f967ae --- /dev/null +++ b/test1-original-code/1.10/1.10.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._10 + enable + enable + + + diff --git a/test1-original-code/1.10/Program.cs b/test1-original-code/1.10/Program.cs new file mode 100644 index 00000000..aa55ff5e --- /dev/null +++ b/test1-original-code/1.10/Program.cs @@ -0,0 +1,13 @@ +using System; +class Program +{ + static void Main() + { + string input = " Hello World ! 你好 世界 ! "; + + // 先去掉首尾空格 -> 按空格分割(去掉多余空格)-> 用单个空格拼接 + string result = string.Join(" ", input.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)); + + Console.WriteLine($"处理后字符串: \"{result}\""); + } +} diff --git a/test1-original-code/1.11/1.11.csproj b/test1-original-code/1.11/1.11.csproj new file mode 100644 index 00000000..c3b78523 --- /dev/null +++ b/test1-original-code/1.11/1.11.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._11 + enable + enable + + + diff --git a/test1-original-code/1.11/Program.cs b/test1-original-code/1.11/Program.cs new file mode 100644 index 00000000..7b5b3153 --- /dev/null +++ b/test1-original-code/1.11/Program.cs @@ -0,0 +1,122 @@ +using System; + +namespace RockPaperScissors +{ + // 枚举定义游戏选项 + public enum Choice + { + Scissors = 1, // 剪刀 + Rock = 2, // 石头 + Paper = 3 // 布 + } + + // 玩家类 + class Player + { + public string Name { get; set; } + + public Player(string name) + { + Name = name; + } + + // 玩家选择出拳 + public Choice MakeChoice() + { + while (true) + { + Console.Write("请选择:1. 剪刀 2. 石头 3. 布 :"); + string input = Console.ReadLine(); + + if (int.TryParse(input, out int choice) && choice >= 1 && choice <= 3) + { + return (Choice)choice; + } + Console.WriteLine("输入无效,请输入 1-3 之间的数字!"); + } + } + } + + // 电脑类 + class Computer + { + private static readonly Random random = new Random(); + + // 电脑随机出拳 + public Choice MakeChoice() + { + return (Choice)random.Next(1, 4); + } + } + + // 游戏逻辑类 + class Game + { + private Player player; + private Computer computer; + + public Game(string playerName) + { + player = new Player(playerName); + computer = new Computer(); + } + + // 判断胜负 + private string DetermineWinner(Choice playerChoice, Choice computerChoice) + { + if (playerChoice == computerChoice) + return "平局!"; + + if ((playerChoice == Choice.Scissors && computerChoice == Choice.Paper) || + (playerChoice == Choice.Rock && computerChoice == Choice.Scissors) || + (playerChoice == Choice.Paper && computerChoice == Choice.Rock)) + { + return $"{player.Name} 获胜!"; + } + + return "电脑获胜! "; + } + + // 游戏开始 + public void Start() + { + Console.WriteLine("\n欢迎来到猜拳小游戏!\n"); + + while (true) + { + // 玩家出拳 + Choice playerChoice = player.MakeChoice(); + Console.WriteLine($"{player.Name} 选择了:{playerChoice}"); + + // 电脑出拳 + Choice computerChoice = computer.MakeChoice(); + Console.WriteLine($"电脑选择了:{computerChoice}"); + + // 计算结果 + Console.WriteLine(DetermineWinner(playerChoice, computerChoice)); + + // 询问是否继续 + Console.Write("\n是否继续游戏?(Y/N): "); + string continueGame = Console.ReadLine().Trim().ToUpper(); + + if (continueGame != "Y") + { + Console.WriteLine("游戏结束,谢谢参与!"); + break; + } + } + } + } + + // 主程序 + class Program + { + static void Main() + { + Console.Write("请输入您的名字: "); + string playerName = Console.ReadLine(); + + Game game = new Game(playerName); + game.Start(); + } + } \ No newline at end of file diff --git a/test1-original-code/1.8/1.8.csproj b/test1-original-code/1.8/1.8.csproj new file mode 100644 index 00000000..d139dfb4 --- /dev/null +++ b/test1-original-code/1.8/1.8.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._8 + enable + enable + + + diff --git a/test1-original-code/1.8/Program.cs b/test1-original-code/1.8/Program.cs new file mode 100644 index 00000000..7f457f8b --- /dev/null +++ b/test1-original-code/1.8/Program.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; + +class Program +{ + static void Main() + { + string text = "患者:“大夫,我咳嗽得很重。”大夫:“你多大年记?”患者:“七十五岁。”大夫:“二十岁咳嗽吗”患者:“不咳嗽。” 大夫:“四十岁时咳嗽吗?” 患者:“也不咳嗽。” 大夫:“那现在不咳嗽,还要等到什么时咳嗽?”"; + + string target = "咳嗽"; + List indices = FindOccurrences(text, target); + + Console.WriteLine($"“{target}” 出现次数: {indices.Count}"); + Console.WriteLine("出现索引位置:"); + foreach (var index in indices) + { + Console.WriteLine(index); + } + } + + // 查找字符串 target 在 text 中的所有索引 + static List FindOccurrences(string text, string target) + { + List indices = new List(); + int index = text.IndexOf(target); // 第一次出现的位置 + + while (index != -1) + { + indices.Add(index); + index = text.IndexOf(target, index + target.Length); // 从上次索引位置之后继续查找 + } + + return indices; + } +} + diff --git a/test1-original-code/1.9/1.9.csproj b/test1-original-code/1.9/1.9.csproj new file mode 100644 index 00000000..0a0a0911 --- /dev/null +++ b/test1-original-code/1.9/1.9.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + _1._9 + enable + enable + + + diff --git a/test1-original-code/1.9/Program.cs b/test1-original-code/1.9/Program.cs new file mode 100644 index 00000000..a12dd435 --- /dev/null +++ b/test1-original-code/1.9/Program.cs @@ -0,0 +1,22 @@ +using System; +class Program +{ + static void Main() + { + string dateStr = "2020年10月1日"; + + // 使用 '年'、'月'、'日' 分割字符串 + string[] parts = dateStr.Split(new char[] { '年', '月', '日' }, StringSplitOptions.RemoveEmptyEntries); + + if (parts.Length == 3) + { + Console.WriteLine($"年: {parts[0]}"); + Console.WriteLine($"月: {parts[1]}"); + Console.WriteLine($"日: {parts[2]}"); + } + else + { + Console.WriteLine("日期格式不正确!"); + } + } +} -- Gitee From 4f75cf3981ff2715149a9492eb2fedf02f6bce08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=97=BB=E6=B4=81?= <2955857091@qq.com> Date: Thu, 13 Mar 2025 03:16:31 +0000 Subject: [PATCH 22/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-original-code/1.9.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-original-code/1.9.txt | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 test1-original-code/1.9.txt diff --git a/test1-original-code/1.9.txt b/test1-original-code/1.9.txt deleted file mode 100644 index a506aef5..00000000 --- a/test1-original-code/1.9.txt +++ /dev/null @@ -1,22 +0,0 @@ -using System; -class Program -{ - static void Main() - { - string dateStr = "2020年10月1日"; - - // 使用 '年'、'月'、'日' 分割字符串 - string[] parts = dateStr.Split(new char[] { '年', '月', '日' }, StringSplitOptions.RemoveEmptyEntries); - - if (parts.Length == 3) - { - Console.WriteLine($"年: {parts[0]}"); - Console.WriteLine($"月: {parts[1]}"); - Console.WriteLine($"日: {parts[2]}"); - } - else - { - Console.WriteLine("日期格式不正确!"); - } - } -} -- Gitee From e6437710b6eb7ee2b23408ddbeca5f46a6ba70fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 12:37:31 +0000 Subject: [PATCH 23/46] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\256\236\351\252\214\344\270\200/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\256\236\351\252\214\344\270\200/.keep" diff --git "a/\345\256\236\351\252\214\344\270\200/.keep" "b/\345\256\236\351\252\214\344\270\200/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From 2e3412819d8bee228688d6f1336a2547ff85e4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:22:08 +0000 Subject: [PATCH 24/46] 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/1.cs" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/1.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/1.cs" "b/\345\256\236\351\252\214\344\270\200/1.cs" new file mode 100644 index 00000000..3aacd48f --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/1.cs" @@ -0,0 +1,16 @@ +/* +using System; +class Program +{ + static void Main() + { + int n1 = 10, n2 = 20; + int n3 = 0; + n3 = n1; + n1 = n2; + n2 = n3; + Console.WriteLine($"n1为{n1},n2为{n2}"); + Console.ReadLine(); + } +} +*/ -- Gitee From d01a5d6f5dd3cdafe303c3d62337a73aae2f5f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:23:35 +0000 Subject: [PATCH 25/46] 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/2.cs" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/2.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/2.cs" "b/\345\256\236\351\252\214\344\270\200/2.cs" new file mode 100644 index 00000000..2a22d0f7 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/2.cs" @@ -0,0 +1,19 @@ +/* +using System; +class Program +{ + static void Main() + { + int n1 = 10, n2 = 20; + Swap(ref n1, ref n2); + Console.WriteLine($"n1为{n1},n2为{n2}"); + Console.ReadLine(); + } + static void Swap(ref int a, ref int b) + { + int temp = a; + a = b; + b = temp; + } +} +*/ \ No newline at end of file -- Gitee From 1286da7111ea78eebab0e9a1710d08b8850ae166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:23:54 +0000 Subject: [PATCH 26/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\256\236\351\252\214\344\270\200/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "\345\256\236\351\252\214\344\270\200/.keep" diff --git "a/\345\256\236\351\252\214\344\270\200/.keep" "b/\345\256\236\351\252\214\344\270\200/.keep" deleted file mode 100644 index e69de29b..00000000 -- Gitee From 11a9960c9de114c346ef2afc518e554b445379b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:24:11 +0000 Subject: [PATCH 27/46] 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/3.cs" | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/3.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/3.cs" "b/\345\256\236\351\252\214\344\270\200/3.cs" new file mode 100644 index 00000000..b9b55f74 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/3.cs" @@ -0,0 +1,33 @@ +/* +using System; +class Program +{ + static void Main() + { + int num1 = 20, num2 = 5; + int addResult, subResult, mulResult; + double divResult; + Calculate(num1, num2, out addResult, out subResult, out mulResult, out divResult); + Console.WriteLine($"加法结果: {addResult}"); + Console.WriteLine($"减法结果: {subResult}"); + Console.WriteLine($"乘法结果: {mulResult}"); + Console.WriteLine($"除法结果: {divResult}"); + Console.ReadLine(); + } + static void Calculate(int a, int b, out int add, out int sub, out int mul, out double div) + { + add = a + b; // 加法 + sub = a - b; // 减法 + mul = a * b; // 乘法 + if (b != 0) + { + div = (double)a / b; + } + else + { + div = 0; + Console.WriteLine("警告:除数不能为 0,除法结果设置为 0。"); + } + } +} +*/ \ No newline at end of file -- Gitee From 42a8a8a77b381596d563a3a1914079845f8595df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:24:27 +0000 Subject: [PATCH 28/46] 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/4.cs" | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/4.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/4.cs" "b/\345\256\236\351\252\214\344\270\200/4.cs" new file mode 100644 index 00000000..ec3bd2d6 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/4.cs" @@ -0,0 +1,29 @@ +/* +using System; +class Program +{ + static void Main() + { + Console.WriteLine("最大值是:" + MaxValue(3, 5, 1, 8, 2)); + Console.WriteLine("最大值是:" + MaxValue(10, -2, 7)); + Console.WriteLine("最大值是:" + MaxValue(42)); + Console.ReadLine(); + } + static int MaxValue(params int[] numbers) + { + if (numbers == null || numbers.Length == 0) + { + throw new ArgumentException("至少需要提供一个数"); + } + int max = numbers[0]; + foreach (int num in numbers) + { + if (num > max) + { + max = num; // 更新最大值 + } + } + return max; + } +} +*/ \ No newline at end of file -- Gitee From 5b21cc0d37b3651a28e7d2e5806b4712bf052636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:24:47 +0000 Subject: [PATCH 29/46] 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/5.cs" | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/5.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/5.cs" "b/\345\256\236\351\252\214\344\270\200/5.cs" new file mode 100644 index 00000000..c51b8e6d --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/5.cs" @@ -0,0 +1,30 @@ +/* +using System; +class Program +{ + static void Main() + { + int n = 20; + long sum = CalculateFibonacciSum(n); + Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); + Console.ReadLine(); + } + static long CalculateFibonacciSum(int n) + { + if (n <= 0) + { + return 0; // 如果 n 小于等于 0,返回 0 + } + long a = 1, b = 1; + long sum = a + b; + for (int i = 3; i <= n; i++) + { + long next = a + b; // 计算下一项 + sum += next; + a = b; + b = next; + } + return sum; + } +} +*/ \ No newline at end of file -- Gitee From f000af8c319434380af0a5b0e3556460c8123660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:25:05 +0000 Subject: [PATCH 30/46] 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/6.cs" | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/6.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/6.cs" "b/\345\256\236\351\252\214\344\270\200/6.cs" new file mode 100644 index 00000000..c0f165b0 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/6.cs" @@ -0,0 +1,30 @@ +/* +using System; +class Program +{ + static void Main() + { + int rows = 10; + PrintPascalTriangle(rows); + Console.ReadLine(); + } + static void PrintPascalTriangle(int rows) + { + for (int i = 0; i < rows; i++) + { + // 打印每行前面的空格,使其居中 + for (int j = 0; j < rows - i - 1; j++) + { + Console.Write(" "); + } + int number = 1; + for (int j = 0; j <= i; j++) + { + Console.Write($"{number,4}"); + number = number * (i - j) / (j + 1); + } + Console.WriteLine(); + } + } +} +*/ \ No newline at end of file -- Gitee From 294a6e222028a1f7cd3fb8b1dafa4735cc13a72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:25:26 +0000 Subject: [PATCH 31/46] 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/7.cs" | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/7.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/7.cs" "b/\345\256\236\351\252\214\344\270\200/7.cs" new file mode 100644 index 00000000..750aa261 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/7.cs" @@ -0,0 +1,41 @@ +/* +using System; + +class Program +{ + static void Main() + { + int[] array = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; + Console.WriteLine("排序前的数组:"); + PrintArray(array); + BubbleSort(array); + Console.WriteLine("\n排序后的数组:"); + PrintArray(array); + Console.ReadLine(); + } + static void BubbleSort(int[] arr) + { + int n = arr.Length; + for (int i = 0; i < n - 1; i++) + { + for (int j = 0; j < n - 1 - i; j++) + { + if (arr[j] > arr[j + 1]) + { + int temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + } + } + static void PrintArray(int[] arr) + { + foreach (int num in arr) + { + Console.Write(num + " "); + } + Console.WriteLine(); + } +} +*/ \ No newline at end of file -- Gitee From 6036b3dcdb3174a46e2cc71cbe98638024b5a75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:25:46 +0000 Subject: [PATCH 32/46] 8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/8.cs" | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/8.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/8.cs" "b/\345\256\236\351\252\214\344\270\200/8.cs" new file mode 100644 index 00000000..fae0e982 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/8.cs" @@ -0,0 +1,28 @@ +/* +using System; +using System.Collections.Generic; +class Program +{ + static void Main() + { + string text = "患者:“大夫,我咳嗽得很重。” 大夫:“你多大年记?” 患者:“七十五岁。” 大夫:“二十岁咳嗽吗”患者:“不咳嗽。” 大夫:“四十岁时咳嗽吗?” 患者:“也不咳嗽。” 大夫:“那现在不咳嗽,还要等到什么时咳嗽?”"; + string keyword = "咳嗽"; // 要查找的关键词 + List indices = new List(); // 存储索引位置 + int count = 0; // 统计出现次数 + int index = text.IndexOf(keyword); + while (index != -1) + { + indices.Add(index); // 记录索引位置 + count++; + index = text.IndexOf(keyword, index + keyword.Length); + } + Console.WriteLine($"“{keyword}”出现的次数: {count}"); + Console.WriteLine("每次出现的索引位置:"); + foreach (int i in indices) + { + Console.WriteLine(i); + } + Console.ReadLine(); + } +} +*/ \ No newline at end of file -- Gitee From 87941daba9c8f1a46cac4ff60765285314e7b51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:26:13 +0000 Subject: [PATCH 33/46] 9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/9.cs" | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/9.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/9.cs" "b/\345\256\236\351\252\214\344\270\200/9.cs" new file mode 100644 index 00000000..a1a65998 --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/9.cs" @@ -0,0 +1,37 @@ +/* +using System; +class Program +{ + static void Main() + { + string dateStr = "2020年10月1日"; + int year = ExtractYear(dateStr); + int month = ExtractMonth(dateStr); + int day = ExtractDay(dateStr); + Console.WriteLine($"年: {year}"); + Console.WriteLine($"月: {month}"); + Console.WriteLine($"日: {day}"); + Console.ReadLine(); + } + static int ExtractYear(string dateStr) + { + int yearEndIndex = dateStr.IndexOf('年'); + string yearStr = dateStr.Substring(0, yearEndIndex); // 截取年份部分 + return int.Parse(yearStr); + } + static int ExtractMonth(string dateStr) + { + int monthStartIndex = dateStr.IndexOf('年') + 1; + int monthEndIndex = dateStr.IndexOf('月'); + string monthStr = dateStr.Substring(monthStartIndex, monthEndIndex - monthStartIndex); // 截取月份部分 + return int.Parse(monthStr); + } + static int ExtractDay(string dateStr) + { + int dayStartIndex = dateStr.IndexOf('月') + 1; + int dayEndIndex = dateStr.IndexOf('日'); + string dayStr = dateStr.Substring(dayStartIndex, dayEndIndex - dayStartIndex); // 截取日期部分 + return int.Parse(dayStr); + } +} +*/ \ No newline at end of file -- Gitee From fea0d037c50c89ea5ed1a70fd65bf1793e634112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E5=BE=AE126?= <2917044647@qq.com> Date: Wed, 19 Mar 2025 13:26:34 +0000 Subject: [PATCH 34/46] 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 熊微126 <2917044647@qq.com> --- "\345\256\236\351\252\214\344\270\200/10.cs" | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 "\345\256\236\351\252\214\344\270\200/10.cs" diff --git "a/\345\256\236\351\252\214\344\270\200/10.cs" "b/\345\256\236\351\252\214\344\270\200/10.cs" new file mode 100644 index 00000000..93ac92dd --- /dev/null +++ "b/\345\256\236\351\252\214\344\270\200/10.cs" @@ -0,0 +1,38 @@ +using System; +using System.Text; +class Program +{ + static void Main() + { + string input = " Hello World ! 你好 世界 ! "; + // 去掉两端空格 + string trimmed = input.Trim(); + // 将连续空格替换为一个空格 + string result = ReplaceMultipleSpaces(trimmed); + Console.WriteLine($"原始字符串: \"{input}\""); + Console.WriteLine($"处理后的字符串: \"{result}\""); + Console.ReadLine(); + } + static string ReplaceMultipleSpaces(string input) + { + StringBuilder sb = new StringBuilder(); + bool isSpace = false; + foreach (char c in input) + { + if (c == ' ') + { + if (!isSpace) + { + sb.Append(c); + isSpace = true; + } + } + else + { + sb.Append(c); + isSpace = false; + } + } + return sb.ToString(); + } +} \ No newline at end of file -- Gitee From 0ae34cb91c97e85002b1971ca5d33d858ed33896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90=E5=86=89?= <2728746853@qq.com> Date: Thu, 20 Mar 2025 10:53:57 +0000 Subject: [PATCH 35/46] =?UTF-8?q?add=20=E5=AE=9E=E9=AA=8C=E4=B8=80/?= =?UTF-8?q?=E5=BC=A0=E6=88=90=E5=86=89=20=E5=AE=9E=E9=AA=8C=E4=B8=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张成冉 <2728746853@qq.com> --- ...\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\256\236\351\252\214\344\270\200/\345\274\240\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" diff --git "a/\345\256\236\351\252\214\344\270\200/\345\274\240\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" "b/\345\256\236\351\252\214\344\270\200/\345\274\240\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" new file mode 100644 index 00000000..e69de29b -- Gitee From e5849d7c32cb6ce7695913381f0c4e142af80107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90=E5=86=89?= <2728746853@qq.com> Date: Thu, 20 Mar 2025 10:54:18 +0000 Subject: [PATCH 36/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80/=E5=BC=A0=E6=88=90=E5=86=89=20?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "\345\256\236\351\252\214\344\270\200/\345\274\240\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" diff --git "a/\345\256\236\351\252\214\344\270\200/\345\274\240\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" "b/\345\256\236\351\252\214\344\270\200/\345\274\240\346\210\220\345\206\211 \345\256\236\351\252\214\344\270\200" deleted file mode 100644 index e69de29b..00000000 -- Gitee From d376e048a2b978484779704730960f8d22d06062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:13:23 +0000 Subject: [PATCH 37/46] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20test1-zy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-zy/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test1-zy/.keep diff --git a/test1-zy/.keep b/test1-zy/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From 6ee98fecde12ad2cad177f72b5ac9d1043f09958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:13:58 +0000 Subject: [PATCH 38/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-zy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-zy/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test1-zy/.keep diff --git a/test1-zy/.keep b/test1-zy/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From 31b24ef5de0416432cd435df4bc2ce9a4495ed13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:20:31 +0000 Subject: [PATCH 39/46] test1-zy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周毅 <2542332373@qq.com> --- test1.sln | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 test1.sln diff --git a/test1.sln b/test1.sln new file mode 100644 index 00000000..257813b3 --- /dev/null +++ b/test1.sln @@ -0,0 +1,79 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34916.146 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1", "1\1.csproj", "{46117978-FA30-4FE0-983B-F79BAE62DF77}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2", "2\2.csproj", "{F0076FF9-F759-47E9-A35B-B23A0C05AF81}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3", "3\3.csproj", "{8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4", "4\4.csproj", "{C03979F5-6F9B-4366-9024-7AC06B58065C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "5", "5\5.csproj", "{E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "6", "6\6.csproj", "{BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7", "7\7.csproj", "{54A789D8-6F8A-492F-B647-E07C9531ECBF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "8", "8\8.csproj", "{8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "9", "9\9.csproj", "{6520D456-B28A-4CCA-859A-8183F3F190FE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10", "10\10.csproj", "{F5079637-EF6D-44CA-8DF8-C454A7DE082A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Release|Any CPU.Build.0 = Release|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Release|Any CPU.Build.0 = Release|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Release|Any CPU.Build.0 = Release|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Release|Any CPU.Build.0 = Release|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Release|Any CPU.Build.0 = Release|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Release|Any CPU.Build.0 = Release|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Release|Any CPU.Build.0 = Release|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Release|Any CPU.Build.0 = Release|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Release|Any CPU.Build.0 = Release|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {29793C4F-B847-40DF-A602-52BA67C3EBC9} + EndGlobalSection +EndGlobal -- Gitee From 534cd2e5ef75362d40831492b5d5639f9fecee5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:20:45 +0000 Subject: [PATCH 40/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1.sln?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1.sln | 79 ------------------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 test1.sln diff --git a/test1.sln b/test1.sln deleted file mode 100644 index 257813b3..00000000 --- a/test1.sln +++ /dev/null @@ -1,79 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.10.34916.146 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1", "1\1.csproj", "{46117978-FA30-4FE0-983B-F79BAE62DF77}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2", "2\2.csproj", "{F0076FF9-F759-47E9-A35B-B23A0C05AF81}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3", "3\3.csproj", "{8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4", "4\4.csproj", "{C03979F5-6F9B-4366-9024-7AC06B58065C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "5", "5\5.csproj", "{E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "6", "6\6.csproj", "{BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7", "7\7.csproj", "{54A789D8-6F8A-492F-B647-E07C9531ECBF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "8", "8\8.csproj", "{8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "9", "9\9.csproj", "{6520D456-B28A-4CCA-859A-8183F3F190FE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10", "10\10.csproj", "{F5079637-EF6D-44CA-8DF8-C454A7DE082A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {46117978-FA30-4FE0-983B-F79BAE62DF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46117978-FA30-4FE0-983B-F79BAE62DF77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46117978-FA30-4FE0-983B-F79BAE62DF77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46117978-FA30-4FE0-983B-F79BAE62DF77}.Release|Any CPU.Build.0 = Release|Any CPU - {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Release|Any CPU.Build.0 = Release|Any CPU - {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Release|Any CPU.Build.0 = Release|Any CPU - {C03979F5-6F9B-4366-9024-7AC06B58065C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C03979F5-6F9B-4366-9024-7AC06B58065C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C03979F5-6F9B-4366-9024-7AC06B58065C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C03979F5-6F9B-4366-9024-7AC06B58065C}.Release|Any CPU.Build.0 = Release|Any CPU - {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Release|Any CPU.Build.0 = Release|Any CPU - {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Release|Any CPU.Build.0 = Release|Any CPU - {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Release|Any CPU.Build.0 = Release|Any CPU - {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Release|Any CPU.Build.0 = Release|Any CPU - {6520D456-B28A-4CCA-859A-8183F3F190FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6520D456-B28A-4CCA-859A-8183F3F190FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6520D456-B28A-4CCA-859A-8183F3F190FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6520D456-B28A-4CCA-859A-8183F3F190FE}.Release|Any CPU.Build.0 = Release|Any CPU - {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {29793C4F-B847-40DF-A602-52BA67C3EBC9} - EndGlobalSection -EndGlobal -- Gitee From a172f3741982e9b82321eba69bea5e02d86fe5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:23:15 +0000 Subject: [PATCH 41/46] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20test1-zy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-zy/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test1-zy/.keep diff --git a/test1-zy/.keep b/test1-zy/.keep new file mode 100644 index 00000000..e69de29b -- Gitee From ccb4516daf8e7263d5bf013ef12515991f24feb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:25:07 +0000 Subject: [PATCH 42/46] =?UTF-8?q?=E5=91=A8=E6=AF=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周毅 <2542332373@qq.com> --- test1-zy/1.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test1-zy/1.cs diff --git a/test1-zy/1.cs b/test1-zy/1.cs new file mode 100644 index 00000000..bb6925ae --- /dev/null +++ b/test1-zy/1.cs @@ -0,0 +1,17 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int n1 = 10, n2 = 20; + + // 交换 + n1 = n1 + n2; // n1 = 30 + n2 = n1 - n2; // n2 = 10 + n1 = n1 - n2; // n1 = 20 + + Console.WriteLine("n1 = " + n1); + Console.WriteLine("n2 = " + n2); + } +} \ No newline at end of file -- Gitee From b1588a8dbb13ea201993db5bb7f15879c0a1a4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:25:59 +0000 Subject: [PATCH 43/46] =?UTF-8?q?=E5=91=A8=E6=AF=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周毅 <2542332373@qq.com> --- test1-zy/10.cs | 33 +++++++++++++++++++++++++++++++++ test1-zy/2.cs | 26 ++++++++++++++++++++++++++ test1-zy/3.cs | 41 +++++++++++++++++++++++++++++++++++++++++ test1-zy/4.cs | 37 +++++++++++++++++++++++++++++++++++++ test1-zy/5.cs | 26 ++++++++++++++++++++++++++ test1-zy/6.cs | 30 ++++++++++++++++++++++++++++++ test1-zy/7.cs | 35 +++++++++++++++++++++++++++++++++++ test1-zy/8.cs | 24 ++++++++++++++++++++++++ test1-zy/9.cs | 17 +++++++++++++++++ 9 files changed, 269 insertions(+) create mode 100644 test1-zy/10.cs create mode 100644 test1-zy/2.cs create mode 100644 test1-zy/3.cs create mode 100644 test1-zy/4.cs create mode 100644 test1-zy/5.cs create mode 100644 test1-zy/6.cs create mode 100644 test1-zy/7.cs create mode 100644 test1-zy/8.cs create mode 100644 test1-zy/9.cs diff --git a/test1-zy/10.cs b/test1-zy/10.cs new file mode 100644 index 00000000..eb1df371 --- /dev/null +++ b/test1-zy/10.cs @@ -0,0 +1,33 @@ +using System; +using System.Text; + +class Program +{ + static void Main(string[] args) + { + string text = " Hello World ! 你好 世界 ! "; + // 去掉两端空格 + text = text.Trim(); + // 替换连续空格为单个空格 + StringBuilder sb = new StringBuilder(); + bool isSpace = false; + + foreach (char c in text) + { + if (c == ' ') + { + if (!isSpace) + { + sb.Append(c); + isSpace = true; + } + } + else + { + sb.Append(c); + isSpace = false; + } + } + Console.WriteLine($"处理后的字符串: \"{sb.ToString()}\""); + } +} \ No newline at end of file diff --git a/test1-zy/2.cs b/test1-zy/2.cs new file mode 100644 index 00000000..1e3f1430 --- /dev/null +++ b/test1-zy/2.cs @@ -0,0 +1,26 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int n1 = 10, n2 = 20; + + Console.WriteLine("交换前:"); + Console.WriteLine("n1 = " + n1); // n1 = 10 + Console.WriteLine("n2 = " + n2); // n2 = 20 + + // 调用交换 + Swap(ref n1, ref n2); + + Console.WriteLine("\n交换后:"); + Console.WriteLine("n1 = " + n1); // n1 = 20 + Console.WriteLine("n2 = " + n2); // n2 = 10 + } + static void Swap(ref int a, ref int b) + { + int temp = a; + a = b; + b = temp; + } +} \ No newline at end of file diff --git a/test1-zy/3.cs b/test1-zy/3.cs new file mode 100644 index 00000000..5463da68 --- /dev/null +++ b/test1-zy/3.cs @@ -0,0 +1,41 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int num1 = 20; + int num2 = 5; + + //计算结果 + int addResult, subResult, mulResult; + double divResult; + + Calculate(num1, num2, out addResult, out subResult, out mulResult, out divResult); + + Console.WriteLine($"加法结果: {addResult}"); + Console.WriteLine($"减法结果: {subResult}"); + Console.WriteLine($"乘法结果: {mulResult}"); + Console.WriteLine($"除法结果: {divResult}"); + } + + static void Calculate(int a, int b, out int add, out int sub, out int mul, out double div) + { + // 加 + add = a + b; + // 减 + sub = a - b; + // 乘 + mul = a * b; + // 除 + if (b != 0) + { + div = (double)a / b; //确保结果是浮点数 + } + else + { + div = 0; //除数为 0,返回 0 + Console.WriteLine("警告:除数不能为 0!"); + } + } +} \ No newline at end of file diff --git a/test1-zy/4.cs b/test1-zy/4.cs new file mode 100644 index 00000000..fd07eb7c --- /dev/null +++ b/test1-zy/4.cs @@ -0,0 +1,37 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int max1 = FindMax(10, 20, 30, 5, 15); // 多参数 + int max2 = FindMax(100); // 单参数 + int max3 = FindMax(); + + Console.WriteLine("最大值1: " + max1); + Console.WriteLine("最大值2: " + max2); + Console.WriteLine("最大值3: " + max3); + } + + // 计算最大值 + static int FindMax(params int[] numbers) + { + if (numbers == null || numbers.Length == 0) + { + Console.WriteLine("警告:未提供任何参数,返回默认值 0。"); + return 0; + } + + int max = numbers[0]; // 假设第一个数为最大值 + + foreach (int num in numbers) + { + if (num > max) + { + max = num; + } + } + + return max; + } +} \ No newline at end of file diff --git a/test1-zy/5.cs b/test1-zy/5.cs new file mode 100644 index 00000000..7980981b --- /dev/null +++ b/test1-zy/5.cs @@ -0,0 +1,26 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int n = 20; + int sum = FibonacciSum(n); + + Console.WriteLine($"斐波那契数列前 {n} 项的和为: {sum}"); + } + + static int FibonacciSum(int n) + { + int a = 0, b = 1, sum = 0; + + for (int i = 0; i < n; i++) + { + sum += a; + int temp = a; + a = b; + b = temp + b; + } + return sum; + } +} \ No newline at end of file diff --git a/test1-zy/6.cs b/test1-zy/6.cs new file mode 100644 index 00000000..85270ad9 --- /dev/null +++ b/test1-zy/6.cs @@ -0,0 +1,30 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int rows = 10; + PrintPascalTriangle(rows); + } + + static void PrintPascalTriangle(int rows) + { + for (int i = 0; i < rows; i++) + { + int number = 1; + for (int j = 0; j < rows - i; j++) + { + Console.Write(" "); // 打印空格对齐 + } + + for (int j = 0; j <= i; j++) + { + Console.Write($"{number,4}"); + number = number * (i - j) / (j + 1); + } + + Console.WriteLine(); + } + } +} \ No newline at end of file diff --git a/test1-zy/7.cs b/test1-zy/7.cs new file mode 100644 index 00000000..c42aa3ad --- /dev/null +++ b/test1-zy/7.cs @@ -0,0 +1,35 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + int[] arr = { 20, 16, 78, 61, 12, 99, 57, 34, 8 }; + + BubbleSort(arr); + + Console.WriteLine("排序后的数组:"); + foreach (int num in arr) + { + Console.Write(num + " "); + } + } + + static void BubbleSort(int[] arr) + { + int n = arr.Length; + for (int i = 0; i < n - 1; i++) + { + for (int j = 0; j < n - 1 - i; j++) + { + if (arr[j] > arr[j + 1]) + { + // 交换 + int temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + } + } +} \ No newline at end of file diff --git a/test1-zy/8.cs b/test1-zy/8.cs new file mode 100644 index 00000000..b39c94fb --- /dev/null +++ b/test1-zy/8.cs @@ -0,0 +1,24 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + string text = "患者:“大夫,我咳嗽得很重。” 大夫:“你多大年记?” 患者:“七十五岁。” 大夫:“二十岁咳嗽吗”患者:“不咳嗽。” 大夫:“四十岁时咳嗽吗?” 患者:“也不咳嗽。” 大夫:“那现在不咳嗽,还要等到什么时咳嗽?”"; + + string keyword = "咳嗽"; + int count = 0; + + Console.WriteLine($"“{keyword}”出现的索引位置:"); + int index = text.IndexOf(keyword); + + while (index != -1) + { + count++; + Console.WriteLine(index); + index = text.IndexOf(keyword, index + keyword.Length); + } + + Console.WriteLine($"“{keyword}”总共出现了 {count} 次。"); + } +} \ No newline at end of file diff --git a/test1-zy/9.cs b/test1-zy/9.cs new file mode 100644 index 00000000..4437f852 --- /dev/null +++ b/test1-zy/9.cs @@ -0,0 +1,17 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + string dateStr = "2020年10月1日"; + + int year = int.Parse(dateStr.Substring(0, 4)); + int month = int.Parse(dateStr.Substring(5, 2)); + int day = int.Parse(dateStr.Substring(8, 1)); + + Console.WriteLine($"年: {year}"); + Console.WriteLine($"月: {month}"); + Console.WriteLine($"日: {day}"); + } +} \ No newline at end of file -- Gitee From 5648f0b58ff700eab76ea252a59034dfabfe66cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:26:05 +0000 Subject: [PATCH 44/46] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20te?= =?UTF-8?q?st1-zy/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test1-zy/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test1-zy/.keep diff --git a/test1-zy/.keep b/test1-zy/.keep deleted file mode 100644 index e69de29b..00000000 -- Gitee From 4559ada88a2ea2422751ca55118bfc38ae358f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=AF=85?= <2542332373@qq.com> Date: Fri, 21 Mar 2025 15:26:46 +0000 Subject: [PATCH 45/46] =?UTF-8?q?=E5=91=A8=E6=AF=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周毅 <2542332373@qq.com> --- test1-zy/test1.sln | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 test1-zy/test1.sln diff --git a/test1-zy/test1.sln b/test1-zy/test1.sln new file mode 100644 index 00000000..257813b3 --- /dev/null +++ b/test1-zy/test1.sln @@ -0,0 +1,79 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34916.146 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1", "1\1.csproj", "{46117978-FA30-4FE0-983B-F79BAE62DF77}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2", "2\2.csproj", "{F0076FF9-F759-47E9-A35B-B23A0C05AF81}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3", "3\3.csproj", "{8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4", "4\4.csproj", "{C03979F5-6F9B-4366-9024-7AC06B58065C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "5", "5\5.csproj", "{E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "6", "6\6.csproj", "{BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7", "7\7.csproj", "{54A789D8-6F8A-492F-B647-E07C9531ECBF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "8", "8\8.csproj", "{8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "9", "9\9.csproj", "{6520D456-B28A-4CCA-859A-8183F3F190FE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10", "10\10.csproj", "{F5079637-EF6D-44CA-8DF8-C454A7DE082A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46117978-FA30-4FE0-983B-F79BAE62DF77}.Release|Any CPU.Build.0 = Release|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0076FF9-F759-47E9-A35B-B23A0C05AF81}.Release|Any CPU.Build.0 = Release|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AE7EA22-7EDB-4701-B42D-E1E3B4A64226}.Release|Any CPU.Build.0 = Release|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C03979F5-6F9B-4366-9024-7AC06B58065C}.Release|Any CPU.Build.0 = Release|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0AFE13D-DBC6-4B7C-B201-DF2D5B48ED82}.Release|Any CPU.Build.0 = Release|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDE6B3FD-C3FA-4066-AADF-801ABA9A7F85}.Release|Any CPU.Build.0 = Release|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54A789D8-6F8A-492F-B647-E07C9531ECBF}.Release|Any CPU.Build.0 = Release|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8EECFF69-700D-4FA3-A1FF-10CE7A8669B2}.Release|Any CPU.Build.0 = Release|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6520D456-B28A-4CCA-859A-8183F3F190FE}.Release|Any CPU.Build.0 = Release|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5079637-EF6D-44CA-8DF8-C454A7DE082A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {29793C4F-B847-40DF-A602-52BA67C3EBC9} + EndGlobalSection +EndGlobal -- Gitee From 35a47aba55ac826b0f16dec5d0e006f970b790c4 Mon Sep 17 00:00:00 2001 From: SJY <3027193823@qq.com> Date: Mon, 24 Mar 2025 08:57:13 +0000 Subject: [PATCH 46/46] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E5=AE=9E=E9=AA=8C1-?= =?UTF-8?q?=E5=AD=99=E9=87=91=E7=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\256\236\351\252\2141-\345\255\231\351\207\221\347\216\211/.keep" diff --git "a/\345\256\236\351\252\2141-\345\255\231\351\207\221\347\216\211/.keep" "b/\345\256\236\351\252\2141-\345\255\231\351\207\221\347\216\211/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee