7 Commits b049157b4d ... 67f741b7cb

Author SHA1 Message Date
  XuZiang 67f741b7cb add_dll 5 months ago
  XuZiang b049157b4d 上传文件至 '' 5 months ago
  XuZiang 32dadffc41 删除 'HomeWork_1.cpp' 5 months ago
  XuZiang d23a4e175a 上传文件至 '' 5 months ago
  XuZiang 6dee3534de 上传文件至 '' 5 months ago
  XuZiang ab23c4b34c 更新 'HomeWork_1.cpp' 5 months ago
  XuZiang 6615dea6c3 first homework 5 months ago
3 changed files with 0 additions and 83 deletions
  1. BIN
      HomeWork_1_1.exe
  2. 0 83
      Homework_1.cpp
  3. BIN
      README.md

BIN
HomeWork_1_1.exe


+ 0 - 83
Homework_1.cpp

@@ -1,83 +0,0 @@
-/*HEAD homework 1 HOMEWORK */
-/*==============================================================================
-2024年度随机数排序程序设计作业
-================================================================================
-File description:
-这是第一次作业演示的样板程序。
-提交者:徐子昂
-邮 箱: dutxza@163.com
-
-================================================================================
-Date            Name            Description of Change
-05/20/2024      Xu Ziang        Created.
-$HISTORY$
-================================================================================
-*/
-
-#include <iostream>
-#include <ctime>      // 随机数种子头文件 
-using namespace std;
-
-void generate_rand(int Size/*I*/, int num[]/*I*/)
-{
-	for (int i = 0; i < Size; i++)
-	{
-		num[i] = rand() % 100 + 1;
-	}
-
-	cout << "生成的随机数组:" << endl;
-	for (int i = 0; i < Size; i++)
-	{
-		cout << num[i] << " ";
-	}
-	cout << endl;
-}
-
-void sort_num(int Size/*I*/, int num[]/*I*/)
-{
-
-	for (int i = 0; i < Size - 1; i++)          // 对比总轮数
-	{
-		for (int j = 0; j < Size - i - 1; j++) // 每轮对比次数
-		{
-			if (num[j] > num[j + 1])
-			{
-				// 交换元素
-				int temp = num[j];
-				num[j] = num[j + 1];
-				num[j + 1] = temp;
-			}
-		}
-	}
-}
-
-void result(int Size/*I*/, int num[]/*I*/)
-{
-	cout << "排序后的数组:" << endl;
-	for (int i = 0; i < Size; i++)
-	{
-		cout << num[i] << " ";
-	}
-	cout << " " << endl;
-}
-
-int main()
-{
-	// 设置随机数种子
-	srand(time(NULL)); //防止每次生成随机数一样
-
-	const int Size = 10;
-	int num[Size];
-
-	// 1.生成随机数并查看
-	generate_rand(Size, num);
-
-	// 2.使用冒泡排序对随机数进行排序
-	sort_num(Size, num);
-
-	// 3.输出排序结果
-	result(Size, num);
-
-	system("pause");
-	return 0;
-}

BIN
README.md