C#初級教程(7)——初級期末檢測

練習 1:計算圓的周長和面積

改編題目:編寫一個 C# 程序,讓用戶輸入圓的半徑,然后計算并輸出該圓的周長和面積,結果保留兩位小數。

using System;class CircleCalculation
{static void Main(){const double pi = 3.14;Console.Write("請輸入圓的半徑:");int n = int.Parse(Console.ReadLine());double circumference = 2 * pi * n;double area = pi * n * n;Console.WriteLine($"半徑為 {n} 的圓的周長為:{circumference:F2}");Console.WriteLine($"半徑為 {n} 的圓的面積為:{area:F2}");}
}

練習 2:兩個變量值交換(兩種方法)

改編題目:編寫一個 C# 程序,實現兩個整數變量值的交換,分別使用臨時變量和不使用臨時變量兩種方法,并輸出交換后的結果

using System;class VariableSwap
{static void Main(){// 方法一:使用臨時變量int a = 8, b = 19;int temp = a;a = b;b = temp;Console.WriteLine($"使用臨時變量交換后,a={a}, b={b}");// 方法二:不使用臨時變量a = 8;b = 19;a = a + b;b = a - b;a = a - b;Console.WriteLine($"不使用臨時變量交換后,a={a}, b={b}");}
}

練習 3:輸入 3 個數,從小到大輸出

改編題目:編寫一個 C# 程序,讓用戶輸入 3 個整數,然后將這 3 個數從小到大排序并輸出。

using System;class SortThreeNumbers
{static void Main(){Console.Write("請您輸入 3 個整數,用空格區分開:");string[] input = Console.ReadLine().Split(' ');int a = int.Parse(input[0]);int b = int.Parse(input[1]);int c = int.Parse(input[2]);if (a > b){int temp = a;a = b;b = temp;}if (a > c){int temp = a;a = c;c = temp;}if (b > c){int temp = b;b = c;c = temp;}Console.WriteLine($"從小到大排序為:{a} {b} {c}");}
}

練習 4:根據學生成績輸出等級

改編題目:編寫一個 C# 程序,讓用戶輸入一個 0 - 100 之間的學生成績,根據成績輸出對應的等級(60 分以下為不及格,60 - 69 為合格,70 - 79 為良,80 - 89 為優,90 以上為超神)。

using System;class GradeEvaluation
{static void Main(){Console.Write("請輸入學生成績(0 - 100):");int score = int.Parse(Console.ReadLine());if (score < 60){Console.WriteLine("不及格");}else if (score >= 60 && score <= 69){Console.WriteLine("合格");}else if (score >= 70 && score <= 79){Console.WriteLine("良");}else if (score >= 80 && score <= 89){Console.WriteLine("優");}else{Console.WriteLine("超神");}}
}

練習 5:求 0 - 100 之間所有偶數和奇數的和

改編題目:編寫一個 C# 程序,計算 0 - 100 之間所有偶數的和以及所有奇數的和,并分別輸出結果。

using System;class EvenOddSum
{static void Main(){int evenSum = 0;int oddSum = 0;for (int i = 0; i <= 100; i++){if (i % 2 == 0){evenSum += i;}else{oddSum += i;}}Console.WriteLine("0 - 100 之間所有偶數的和為:" + evenSum);Console.WriteLine("0 - 100 之間所有奇數的和為:" + oddSum);}
}

練習 6:求 10 的階乘

改編題目:編寫一個 C# 程序,計算 10 的階乘并輸出結果。

using System;class FactorialCalculation
{static void Main(){int result = 1;for (int i = 1; i <= 10; i++){result *= i;}Console.WriteLine("10 的階乘為:" + result);}
}

練習 7:反向輸出數字

改編題目:編寫一個 C# 程序,讓用戶輸入一個整數,然后將該整數反向輸出。

using System;class ReverseNumber
{static void Main(){Console.Write("請輸入一個整數:");int num = int.Parse(Console.ReadLine());int reversed = 0;while (num != 0){reversed = reversed * 10 + num % 10;num /= 10;}Console.WriteLine("反向輸出的數字為:" + reversed);}
}

練習 8:輸出指定形狀

改編題目:編寫一個 C# 程序,在屏幕上輸出如下形狀:

*
**
***
****
*****
******
using System;class ShapeOutput1
{static void Main(){for (int i = 1; i <= 6; i++){for (int j = 0; j < i; j++){Console.Write("*");}Console.WriteLine();}}
}

練習 10:單循環輸出指定形狀

改編題目:編寫一個 C# 程序,使用單循環在屏幕上輸出如下形狀:

*
**
***
****
*****
******
using System;class ShapeOutputSingleLoop
{static void Main(){string stars = "";for (int i = 1; i <= 6; i++){stars += "*";Console.WriteLine(stars);}}
}

練習 11:輸出指定對稱形狀

改編題目:編寫一個 C# 程序,在屏幕上輸出如下形狀:

*
***
*****
*******
*********
*******
*****
***
*
using System;class SymmetricShapeOutput
{static void Main(){int maxStars = 9;for (int i = 1; i <= maxStars; i += 2){for (int j = 0; j < (maxStars - i) / 2; j++){Console.Write(" ");}for (int k = 0; k < i; k++){Console.Write("*");}Console.WriteLine();}for (int i = maxStars - 2; i >= 1; i -= 2){for (int j = 0; j < (maxStars - i) / 2; j++){Console.Write(" ");}for (int k = 0; k < i; k++){Console.Write("*");}Console.WriteLine();}}
}

練習 12:打印 9 * 9 乘法表

改編題目:編寫一個 C# 程序,打印 9 * 9 乘法表。

using System;class MultiplicationTable
{static void Main(){for (int i = 1; i <= 9; i++){for (int j = 1; j <= i; j++){Console.Write($"{j} * {i} = {i * j}\t");}Console.WriteLine();}}
}

練習 13:找出 100 到 999 之間的水仙花數(兩種方法)

改編題目:編寫一個 C# 程序,找出 100 到 999 之間的所有水仙花數,分別使用單循環和嵌套循環兩種方法。

using System;class NarcissisticNumbersSingleLoop
{static void Main(){for (int num = 100; num < 1000; num++){int hundreds = num / 100;int tens = (num / 10) % 10;int units = num % 10;if (hundreds * hundreds * hundreds + tens * tens * tens + units * units * units == num){Console.WriteLine(num);}}}
}

C# 代碼(嵌套循環)

using System;class NarcissisticNumbersNestedLoop
{static void Main(){for (int i = 1; i <= 9; i++){for (int j = 0; j <= 9; j++){for (int k = 0; k <= 9; k++){int num = i * 100 + j * 10 + k;if (i * i * i + j * j * j + k * k * k == num){Console.WriteLine(num);}}}}}
}

練習 14:組成不重復的三位數

改編題目:編寫一個 C# 程序,使用 1、2、3、4 四個數字,找出能組成多少個不相同且無重復數字的三位數,并輸出這些三位數。

using System;class ThreeDigitNumbers
{static void Main(){int count = 0;for (int i = 1; i <= 4; i++){for (int j = 1; j <= 4; j++){if (j == i) continue;for (int k = 1; k <= 4; k++){if (k == i || k == j) continue;int num = i * 100 + j * 10 + k;Console.WriteLine(num);count++;}}}Console.WriteLine("能組成的不相同且無重復數字的三位數共有:" + count + " 個");}
}

練習 15:歌星大賽打分計算平均分

改編題目:編寫一個 C# 程序,模擬歌星大賽打分過程。假設有 100 個評委給選手打分,分值在 1 - 100 之間,去掉一個最高分和一個最低分后,計算剩余 98 個分數的平均分作為選手的最后得分。

using System;class SingerCompetitionScore
{static void Main(){Random random = new Random();int[] scores = new int[100];for (int i = 0; i < 100; i++){scores[i] = random.Next(1, 101);}int maxScore = scores[0];int minScore = scores[0];int totalScore = 0;foreach (int score in scores){if (score > maxScore) maxScore = score;if (score < minScore) minScore = score;totalScore += score;}totalScore = totalScore - maxScore - minScore;double averageScore = (double)totalScore / 98;Console.WriteLine("選手的最后得分是:" + averageScore);}
}

練習 16:可樂兌換問題

改編題目:已知 3 個可樂瓶可以換一瓶可樂,現在有 364 瓶可樂,編寫一個 C# 程序,計算一共可以喝多少瓶可樂,最后剩下幾個空瓶。

using System;class ColaExchange
{static void Main(){int totalCola = 364;int emptyBottles = 364;while (emptyBottles >= 3){int exchangedCola = emptyBottles / 3;totalCola += exchangedCola;emptyBottles = emptyBottles % 3 + exchangedCola;}Console.WriteLine("一共可以喝 " + totalCola + " 瓶可樂,剩下 " + emptyBottles + " 個空瓶。");}
}

練習 17:兔子繁殖問題

改編題目:有一對兔子,從出生后第 3 個月起,每個月都生一對兔子;小兔子長到第三個月后,每個月又生一對兔子。假如兔子都不死,編寫一個 C# 程序,計算第 1 到第 20 個月里,每個月的兔子總數。

using System;class RabbitReproduction
{static void Main(){int[] rabbits = new int[20];rabbits[0] = 1;rabbits[1] = 1;for (int i = 2; i < 20; i++){rabbits[i] = rabbits[i - 1] + rabbits[i - 2];}for (int i = 0; i < 20; i++){Console.WriteLine($"第 {i + 1} 個月的兔子總數為:{rabbits[i]} 對");}}
}

練習 18:百錢百雞問題

改編題目:編寫一個 C# 程序,解決百錢百雞問題。已知公雞 5 元一只,母雞 3 元一只,小雞 1 元 3 只,現在有 100 元錢要買 100 只雞,找出所有可能的購買方案并輸出。
C# 代碼

using System;class HundredMoneyHundredChickens
{static void Main(){for (int rooster = 0; rooster <= 20; rooster++){for (int hen = 0; hen <= 33; hen++){int chick = 100 - rooster - hen;if (chick % 3 == 0 && rooster * 5 + hen * 3 + chick / 3 == 100){Console.WriteLine($"公雞:{rooster} 只,母雞:{hen} 只,小雞:{chick} 只");}}}}
}

練習 19:輸出一個 120 - 245 之間的隨機數

改編題目:編寫一個 C# 程序,模擬抽獎活動,每次運行程序時,從 120 到 245 這個區間內隨機抽取一個幸運號碼并輸出。
using System;class RandomNumberInRange
{static void Main(){Random random = new Random();int luckyNumber = random.Next(120, 246);Console.WriteLine($"本次抽獎的幸運號碼是: {luckyNumber}");}
}

練習 20:猜數字游戲

設計一個 C# 程序實現猜數字游戲。程序會隨機生成一個 0 到 50 之間的整數,玩家需要猜測這個數字。每次猜測后,程序會提示玩家猜大了、猜小了還是猜對了,直到玩家猜對為止。同時,記錄玩家猜測的次數并在猜對后輸出。

using System;class GuessTheNumberGame
{static void Main(){Random random = new Random();int secretNumber = random.Next(0, 51);int guess;int attempts = 0;Console.WriteLine("我心里想了一個 0 到 50 之間的數字,你可以開始猜啦!");do{Console.Write("請輸入你猜測的數字: ");guess = int.Parse(Console.ReadLine());attempts++;if (guess < secretNumber){Console.WriteLine($"你猜小了,這個數字比 {guess} 大。");}else if (guess > secretNumber){Console.WriteLine($"你猜大了,這個數字比 {guess} 小。");}else{Console.WriteLine($"恭喜你,猜對了!這個數字就是 {secretNumber}。你一共用了 {attempts} 次猜測。");}} while (guess != secretNumber);}
}

練習 21:初始化數組并倒序輸出

改編題目:編寫一個 C# 程序,創建一個包含 10 個元素的整數數組,使用隨機數為數組元素賦值(范圍為 1 - 100),然后將數組元素倒序排列并輸出。
using System;class ReverseRandomArray
{static void Main(){int[] array = new int[10];Random random = new Random();// 用隨機數初始化數組for (int i = 0; i < array.Length; i++){array[i] = random.Next(1, 101);}// 倒序數組Array.Reverse(array);// 輸出倒序后的數組Console.WriteLine("倒序后的數組元素為:");foreach (int num in array){Console.Write(num + " ");}Console.WriteLine();}
}

練習 22:初始化數組并亂序輸出(兩種方法)

改編題目:在 C# 中,創建一個包含 10 個元素的數組,元素值為 0 到 10,然后使用兩種不同的方法將數組元素打亂順序并輸出。
using System;class ShuffleArray
{static void Main(){int[] array = new int[10];for (int i = 0; i < array.Length; i++){array[i] = i;}// 方法一:使用 Random 類交換元素int[] shuffledArray1 = (int[])array.Clone();Random random = new Random();for (int i = shuffledArray1.Length - 1; i > 0; i--){int j = random.Next(i + 1);int temp = shuffledArray1[i];shuffledArray1[i] = shuffledArray1[j];shuffledArray1[j] = temp;}Console.WriteLine("方法一亂序后的數組:");foreach (int num in shuffledArray1){Console.Write(num + " ");}Console.WriteLine();// 方法二:使用 List 和 Random 類System.Collections.Generic.List<int> list = new System.Collections.Generic.List<int>(array);int[] shuffledArray2 = new int[list.Count];for (int i = 0; i < shuffledArray2.Length; i++){int index = random.Next(list.Count);shuffledArray2[i] = list[index];list.RemoveAt(index);}Console.WriteLine("方法二亂序后的數組:");foreach (int num in shuffledArray2){Console.Write(num + " ");}Console.WriteLine();}
}

練習 23:一維數組奇數偶數分區

改編題目:編寫一個 C# 程序,創建一個包含 20 個元素的一維數組,使用隨機數(范圍 1 - 100)初始化數組。然后將數組中的奇數元素移到數組左邊,偶數元素移到數組右邊,并輸出分區后的數組。
using System;class OddEvenPartition
{static void Main(){int[] array = new int[20];Random random = new Random();// 用隨機數初始化數組for (int i = 0; i < array.Length; i++){array[i] = random.Next(1, 101);}// 分區操作int left = 0;int right = array.Length - 1;while (left < right){while (left < right && array[left] % 2 != 0){left++;}while (left < right && array[right] % 2 == 0){right--;}if (left < right){int temp = array[left];array[left] = array[right];array[right] = temp;}}// 輸出分區后的數組Console.WriteLine("分區后的數組:");foreach (int num in array){Console.Write(num + " ");}Console.WriteLine();}
}

練習 24:數組排序(選擇、冒泡、插入)

改編題目:編寫一個 C# 程序,創建一個包含 10 個隨機整數(范圍 1 - 100)的數組,分別使用選擇排序、冒泡排序和插入排序算法對數組進行排序,并輸出排序后的數組。
using System;class ArraySorting
{static void Main(){int[] array = new int[10];Random random = new Random();// 用隨機數初始化數組for (int i = 0; i < array.Length; i++){array[i] = random.Next(1, 101);}// 選擇排序int[] selectionSorted = (int[])array.Clone();for (int i = 0; i < selectionSorted.Length - 1; i++){int minIndex = i;for (int j = i + 1; j < selectionSorted.Length; j++){if (selectionSorted[j] < selectionSorted[minIndex]){minIndex = j;}}int temp = selectionSorted[i];selectionSorted[i] = selectionSorted[minIndex];selectionSorted[minIndex] = temp;}Console.WriteLine("選擇排序后的數組:");foreach (int num in selectionSorted){Console.Write(num + " ");}Console.WriteLine();// 冒泡排序int[] bubbleSorted = (int[])array.Clone();for (int i = 0; i < bubbleSorted.Length - 1; i++){for (int j = 0; j < bubbleSorted.Length - i - 1; j++){if (bubbleSorted[j] > bubbleSorted[j + 1]){int temp = bubbleSorted[j];bubbleSorted[j] = bubbleSorted[j + 1];bubbleSorted[j + 1] = temp;}}}Console.WriteLine("冒泡排序后的數組:");foreach (int num in bubbleSorted){Console.Write(num + " ");}Console.WriteLine();// 插入排序int[] insertionSorted = (int[])array.Clone();for (int i = 1; i < insertionSorted.Length; i++){int key = insertionSorted[i];int j = i - 1;while (j >= 0 && insertionSorted[j] > key){insertionSorted[j + 1] = insertionSorted[j];j--;}insertionSorted[j + 1] = key;}Console.WriteLine("插入排序后的數組:");foreach (int num in insertionSorted){Console.Write(num + " ");}Console.WriteLine();}
}

練習 25:二維數組(2 * 3)賦值(兩種方法,單循環、嵌套循環)

改編題目:編寫一個 C# 程序,創建一個 2 行 3 列的二維整數數組,分別使用單循環和嵌套循環的方法為數組元素賦值,賦值規則為從 1 開始依次遞增,并輸出數組元素。
using System;class TwoDimensionalArrayAssignment
{static void Main(){int[,] array = new int[2, 3];// 方法一:單循環賦值int index = 1;for (int i = 0; i < array.GetLength(0); i++){for (int j = 0; j < array.GetLength(1); j++){array[i, j] = index++;}}Console.WriteLine("單循環賦值后的數組:");for (int i = 0; i < array.GetLength(0); i++){for (int j = 0; j < array.GetLength(1); j++){Console.Write(array[i, j] + " ");}Console.WriteLine();}// 方法二:嵌套循環賦值index = 1;for (int i = 0; i < array.GetLength(0); i++){for (int j = 0; j < array.GetLength(1); j++){array[i, j] = index++;}}Console.WriteLine("嵌套循環賦值后的數組:");for (int i = 0; i < array.GetLength(0); i++){for (int j = 0; j < array.GetLength(1); j++){Console.Write(array[i, j] + " ");}Console.WriteLine();}}
}

練習 26:數組內容拷貝

改編題目:編寫一個 C# 程序,有一個 2 行 3 列的二維數組?arr1,其元素值為?{{1, 2, 3}, {4, 5, 6}},將該數組的元素按順序拷貝到一個 3 行 2 列的二維數組?arr2?中,并輸出?arr2?的元素。
using System;class ArrayCopying
{static void Main(){int[,] arr1 = { { 1, 2, 3 }, { 4, 5, 6 } };int[,] arr2 = new int[3, 2];int row = 0;int col = 0;for (int i = 0; i < arr1.GetLength(0); i++){for (int j = 0; j < arr1.GetLength(1); j++){arr2[row, col] = arr1[i, j];col++;if (col == arr2.GetLength(1)){col = 0;row++;}}}Console.WriteLine("拷貝后的數組 arr2:");for (int i = 0; i < arr2.GetLength(0); i++){for (int j = 0; j < arr2.GetLength(1); j++){Console.Write(arr2[i, j] + " ");}Console.WriteLine();}}
}

練習 28:初始化特定數組(兩種方法)

改編題目:在 C# 中,使用兩種不同的方法初始化一個 9 行 9 列的二維數組,數組元素按照如下規律排列:
1 1 1 1 1 1 1 1 1
1 2 2 2 2 2 2 2 1
1 2 3 3 3 3 3 2 1
1 2 3 4 4 4 3 2 1
1 2 3 4 5 4 3 2 1
1 2 3 4 4 4 3 2 1
1 2 3 3 3 3 3 2 1
1 2 2 2 2 2 2 2 1
1 1 1 1 1 1 1 1 1
using System;class SpecialArrayInitialization
{static void Main(){int[,] array = new int[9, 9];// 方法一:嵌套循環手動賦值for (int i = 0; i < 9; i++){for (int j = 0; j < 9; j++){int min = Math.Min(i, j);min = Math.Min(min, 8 - i);min = Math.Min(min, 8 - j);array[i, j] = min + 1;}}Console.WriteLine("方法一初始化后的數組:");for (int i = 0; i < 9; i++){for (int j = 0; j < 9; j++){Console.Write(array[i, j] + " ");}Console.WriteLine();}// 方法二:分層賦值int[,] array2 = new int[9, 9];for (int layer = 0; layer < 5; layer++){for (int i = layer; i < 9 - layer; i++){for (int j = layer; j < 9 - layer; j++){array2[i, j] = layer + 1;}}}Console.WriteLine("方法二初始化后的數組:");for (int i = 0; i < 9; i++){for (int j = 0; j < 9; j++){Console.Write(array2[i, j] + " ");}Console.WriteLine();}}
}

練習 29:輸出楊輝三角(二維數組法)n 層

改編題目

編寫一個 C# 程序,讓用戶輸入一個正整數?n,然后使用二維數組的方法輸出?n?層的楊輝三角。

using System;class PascalTriangle
{static void Main(){Console.Write("請輸入要輸出的楊輝三角的層數: ");int n = int.Parse(Console.ReadLine());int[,] triangle = new int[n, n];for (int i = 0; i < n; i++){for (int j = 0; j <= i; j++){if (j == 0 || j == i){triangle[i, j] = 1;}else{triangle[i, j] = triangle[i - 1, j - 1] + triangle[i - 1, j];}}}Console.WriteLine("楊輝三角:");for (int i = 0; i < n; i++){for (int k = 0; k < n - i - 1; k++){Console.Write("  ");}for (int j = 0; j <= i; j++){Console.Write(triangle[i, j].ToString().PadLeft(4));}Console.WriteLine();

結語:C#初級教程到此結束,感謝努力進步的你,愿你學習之路一路繁花

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/71690.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/71690.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/71690.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Java 集合:單列集合和雙列集合的深度剖析

引言 在 Java 編程中&#xff0c;集合是一個非常重要的概念。它就像是一個容器&#xff0c;能夠存儲多個數據元素&#xff0c;幫助我們更方便地管理和操作數據。Java 集合框架主要分為單列集合和雙列集合兩大類&#xff0c;它們各自有著獨特的特點和適用場景。接下來&#xff0…

layui 遠程搜索下拉選擇組件(多選)

模板使用&#xff08;lay-module/searchSelect&#xff09;&#xff0c;依賴于 jquery、layui.dist 中的 dropdown 模塊實現&#xff08;所以data 格式請參照 layui文檔&#xff09; <link rel"stylesheet" href"layui-v2.5.6/dist/css/layui.css" /&g…

通俗易懂的DOM1級標準介紹

前言 在前端開發中&#xff0c;DOM&#xff08;文檔對象模型&#xff09;是我們操作網頁內容的核心工具。前面的文章我們介紹了DOM0級、DOM2級事件模型&#xff0c;沒有DOM1級事件模型這種概念&#xff0c;但有DOM1級標準。今天我們就來討論DOM1級標準&#xff0c;看看它到底做…

python~http的請求參數中攜帶map

背景 調試 http GET請求的 map 參數&#xff0c;鏈路攜帶參數一直有問題&#xff0c;最終采用如下方式攜帶map 解決 user{"demo":"true","info":"王者"}url encode之后的效果如下所示 user%7B%22demo%22:%22true%22,%22info%22:%22…

(java/Spring boot)使用火山引擎官方推薦方法向大模型發送請求

首先在maven里面引入官方依賴 <dependency><groupId>com.volcengine</groupId><artifactId>volcengine-java-sdk-ark-runtime</artifactId><version>LATEST</version></dependency>然后我們編寫測試類 package com.volcengin…

Scrum方法論指導下的Deepseek R1醫療AI部署開發

一、引言 1.1 研究背景與意義 在當今數智化時代&#xff0c;軟件開發方法論對于項目的成功實施起著舉足輕重的作用。Scrum 作為一種廣泛應用的敏捷開發方法論&#xff0c;以其迭代式開發、快速反饋和高效協作的特點&#xff0c;在軟件開發領域占據了重要地位。自 20 世紀 90 …

LeetCode 熱題 100_搜索插入位置(63_35_簡單_C++)(二分查找)(”>>“ 與 “/” 對比)

LeetCode 熱題 100_搜索插入位置&#xff08;63_35&#xff09; 題目描述&#xff1a;輸入輸出樣例&#xff1a;題解&#xff1a;解題思路&#xff1a;思路一&#xff08;二分查找&#xff09;&#xff1a; 代碼實現代碼實現&#xff08;思路一&#xff08;二分查找&#xff09…

藍橋與力扣刷題(藍橋 交換瓶子)

題目&#xff1a;有 N 個瓶子&#xff0c;編號 1 ~ N&#xff0c;放在架子上。 比如有 5 個瓶子&#xff1a; 2 1 3 5 4 要求每次拿起 2 個瓶子&#xff0c;交換它們的位置。 經過若干次后&#xff0c;使得瓶子的序號為&#xff1a; 1 2 3 4 5 對于這么簡單的情況&#x…

HTTPS 通信流程

HTTPS 通信流程時序圖&#xff1a; #mermaid-svg-HWoTbFvfih6aYUu6 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-HWoTbFvfih6aYUu6 .error-icon{fill:#552222;}#mermaid-svg-HWoTbFvfih6aYUu6 .error-text{fill:#…

Spring AutoWired與Resource區別?

大家好&#xff0c;我是鋒哥。今天分享關于【Spring AutoWired與Resource區別?】面試題。希望對大家有幫助&#xff1b; Spring AutoWired與Resource區別? 1000道 互聯網大廠Java工程師 精選面試題-Java資源分享網 在 Spring 中&#xff0c;Autowired 和 Resource 都是用于…

什么是HTTP/2協議?NGINX如何支持HTTP/2并提升網站性能?

HTTP/2是一種用于在Web瀏覽器和服務器之間進行通信的協議&#xff0c;旨在提高網站性能和加載速度。它是HTTP/1.1的繼任者&#xff0c;引入了許多優化和改進&#xff0c;以適應現代Web應用的需求。HTTP/2的主要目標是減少延遲、提高效率&#xff0c;以及更好地支持并發請求。 …

【Bluedroid】AVRCP 連接源碼分析(一)

一、AVRCP協議簡介 AVRCP(Audio/Video Remote Control Profile)是藍牙協議棧中的一個重要部分,它定義了藍牙設備之間的音視頻傳輸控制的流程和特點。AVRCP使得用戶可以通過一個藍牙設備(如手機)遠程控制另一個藍牙設備(如藍牙耳機或音箱)上的音視頻播放,如播放、暫停、…

【QT中的一些高級數據結構,持續更新中...】

QT中有一些很精妙、便捷的設計&#xff0c;在了解這些數據的同時&#xff0c;我們可以學到如何更好的設計代碼。本貼持續更新中&#xff0c;歡迎關注和收藏 一 QScopedPointer主要特點&#xff1a;示例代碼 二 Q_DISABLE_COPY 一 QScopedPointer QScopedPointer 是 Qt 中的一種…

行業分析---對自動駕駛規控算法的思考

1 前言 隨著自動駕駛端到端大模型的興起&#xff0c;小鵬、華為、理想、蔚來、小米等公司都對自動駕駛業務部進行了組織架構的調整&#xff0c;準備應對新的或者更高級別的自動駕駛研發任務。 近幾年由于自動駕駛技術的快速發展&#xff0c;不少從業者覺得相關職業的未來充滿了…

C++ 設計模式-模板方法模式

文件處理 #include <iostream>// 抽象基類&#xff1a;定義模板方法和抽象步驟 class DataProcessor { public:// 模板方法&#xff08;固定流程&#xff09;void Process() {OpenFile();ProcessData(); // 由子類實現CloseFile();}protected:virtual void ProcessData…

Deepseek快速做PPT

背景: DeepSeek大綱生成 → Kimi結構化排版 → 數據審查,細節調整 DeepSeek 擁有深度思考能力,擅長邏輯構建與內容生成,它會根據我們的問題進行思考,其深度思考能力當前測試下來,不愧為國內No.1,而且還會把中間的思考過程展示出來,大多時候會給出很多我們意想不到的思…

【多語言生態篇一】【DeepSeek×Java:Spring Boot微服務集成全棧指南 】

(手把手帶你從零實現AI能力調用,萬字長文預警,建議收藏實操) 一、環境準備:別輸在起跑線上 1.1 硬件軟件全家桶 JDK版本:必須 ≥17(Spring Boot 3.2+強制要求,低版本直接報錯)IDE推薦:IntelliJ IDEA終極版(社區版缺Spring AI插件支持)構建工具:Maven 3.9+ / Grad…

【YOLOv8】損失函數

學習視頻&#xff1a; yolov8 | 損失函數 之 5、類別損失_嗶哩嗶哩_bilibili yolov8 | 損失函數 之 6、定位損失 CIoU DFL_嗶哩嗶哩_bilibili 2.13、yolov8損失函數_嗶哩嗶哩_bilibili YOLOv8 的損失函數由類別損失和定位損失構成 類別損失&#xff1a;BCE Loss 定位損失…

DEMF模型賦能多模態圖像融合,助力肺癌高效分類

目錄 論文創新點 實驗設計 1. 可視化的研究設計 2. 樣本選取和數據處理 3. 集成分類模型 4. 實驗結果 5. 可視化結果 圖表總結 可視化知識圖譜 在肺癌早期篩查中,計算機斷層掃描(CT)和正電子發射斷層掃描(PET)作為兩種關鍵的影像學手段,分別提供了豐富的解剖結構…

小魚深度評測 | 通義靈碼2.0,不僅可跨語言編碼,自動生成單元測試等,更炸裂的是集成DeepSeek模型且免費使用,太炸裂了。

小魚深度評測 通義靈碼2.0 1、引言2、通義靈碼 更新與安裝2.1 IDE插件更新2.1.1 PyCharm 更新2.1.2 VSCode 更新 2.2 官網下載更新 3、 使用體驗3.1生成單元測試3. 2 跨語言編程3.3靈碼2.0 與1.0 對比 4、總結 1、引言 通義靈碼&#xff0c; 我一直使用的編碼協助工具&#xf…