24-暑假軟體工程日報(7_5)

KuanDong24發表於2024-07-07

工作時間:7月5日 8:00-11:00 14:00-17:00

工作內容:

完成組長大程式驗收

學習Oracle資料庫架構

程式碼:

24-暑假軟體工程日報(7_5)
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
void menu()
{
    cout << "************選單************" << endl
         << endl
         << "    1------20223766-鄭盾" << endl
         << endl
         << "    2------20223768-李健龍" << endl
         << endl
         << "    3------20224059-王昊烜" << endl
         << endl
         << "    4------20223824-白卓冉" << endl
         << endl
         << "    5------20223918-劉霖" << endl
         << endl
         << "    0------退出          " << endl
         << endl
         << "請選擇:" << endl;
    return;
}
void menu1() // 子選單1
{
    cout << "專案1:7-3 修建道路" << endl
         << "專案2:7-6 雜湊表查詢" << endl
         << "專案3:7-7 平衡二叉樹的根" << endl
         << "專案4:7-13 中綴表示式轉換為字尾表示式並求值" << endl
         << "0------退出     " << endl
         << "請選擇:" << endl;
    return;
}
void menu2() // 子選單2
{
    cout << "專案1:6-2 最短路徑(迪傑斯特拉演算法)" << endl
         << "專案2:6-4 希爾排序的實現" << endl
         << "專案3:7-4 先序和中序構造二叉樹" << endl
         << "專案4:7-14 矩陣運算" << endl
         << "0------退出         " << endl
         << "請選擇:" << endl;
    return;
}
void menu3() // 子選單3
{
    cout << "專案1:6-3 最短路徑(弗洛伊德演算法)" << endl
         << "專案2:7-8 任務排程的合理性" << endl
         << "專案3:7-9 老闆的作息表" << endl
         << "專案4:7-15 列出連通集" << endl
         << "0------退出     " << endl
         << "請選擇:" << endl;
    return;
}
void menu4() // 子選單4
{
    cout << "專案1:6-1 最小生成樹(普里姆演算法)" << endl
         << "專案2:7-2 關鍵路徑 " << endl
         << "專案3:7-10 尋找大富翁" << endl
         << "專案4:7-16 重排連結串列" << endl
         << "0------退出     " << endl
         << "請選擇:" << endl;
    return;
}
void menu5() // 子選單5
{
    cout << "專案1:7-1 jmu-ds-實現KMP" << endl
         << "專案2:7-5 哈夫曼編碼譯碼   " << endl
         << "專案3:7-11 二路歸併排序" << endl
         << "專案4:7-12 鏈式基數排序" << endl
         << "0------退出     " << endl
         << "請選擇:" << endl;
    return;
}
int main()
{
    int flag = 0, dddd;
    menu();
    cin >> flag;
    while (flag != 0)
    {
        switch (flag)
        {
        case 1:
        {
            int n = 0, m = 0;
            menu1();
            cin >> n;
            while (n)
            {
                switch (n)
                {
                case 1:
                    system("7_3.exe");
                    cout << endl;
                    break;
                case 2:
                    system("7_6.exe");
                    cout << endl;
                    break;
                case 3:
                    system("7_7.exe");
                    cout << endl;
                    break;
                case 4:
                    system("7_13.exe");
                    cout << endl;
                default:
                    m = 0;
                    break;
                }
                if (m == 0)
                    n = 0;
                else
                {
                    menu1();
                    cin >> n;
                }
            }
            cout << "返回到主程式中" << endl;
            break;
        }
        case 2:
        {
            int n = 0, m;
            menu2();
            cin >> n;
            while (n)
            {
                switch (n)
                {
                case 1:
                    system("6_2.exe");
                    cout << endl;
                    break;
                case 2:
                    system("6_4.exe");
                    cout << endl;
                    break;
                case 3:
                    system("7_4.exe");
                    cout << endl;
                    break;
                case 4:
                    system("7_14.exe");
                    cout << endl;
                default:
                    m = 0;
                    break;
                }
                if (m == 0)
                    n = 0;
                else
                {
                    menu2();
                    cin >> n;
                }
            }
            cout << "返回到主程式中" << endl;
            break;
        }
        case 3:
        {
            int n = 0, m;
            menu3();
            cin >> n;
            while (n)
            {
                switch (n)
                {
                case 1:
                    system("6_3.exe");
                    cout << endl;
                    break;
                case 2:
                    system("7_8.exe");
                    cout << endl;
                    break;
                case 3:
                    system("7_9.exe");
                    break;
                case 4:
                    system("7_15.exe");
                    cout << endl;
                default:
                {
                    m = 0;
                    break;
                }

                    // break;
                }
                if (m == 0)
                {
                    n = 0;
                    break;
                }
                else
                {
                    menu3();
                    cin >> n;
                }
            }
            cout << "返回到主程式中" << endl;
            break;
        }
        case 4:
        {
            int n = 0, m;
            menu1();
            cin >> n;
            while (n)
            {
                switch (n)
                {
                case 1:
                    system("6_1.exe");
                    cout << endl;
                    break;
                case 2:
                    system("7_2.exe");
                    cout << endl;
                    break;
                case 3:
                    system("7_10.exe");
                    cout << endl;
                    break;
                case 4:
                    system("7_16.exe");
                    cout << endl;
                default:
                    m = 0;
                    break;
                }
                if (m == 0)
                    n = 0;
                else
                {
                    menu4();
                    cin >> n;
                }
            }
            cout << "返回到主程式中" << endl;
            break;
        }
        case 5:
        {
            int n = 0, m;
            menu5();
            cin >> n;
            while (n)
            {
                switch (n)
                {
                case 1:
                    system("7_1.exe");
                    cout << endl;
                    break;
                case 2:
                    system("7_5.exe");
                    cout << endl;
                    break;
                case 3:
                    system("7_11.exe");
                    cout << endl;
                    break;
                case 4:
                    system("7_12.exe");
                    cout << endl;
                default:
                    m = 0;
                    break;
                }
                if (m == 0)
                    n = 0;
                else
                {
                    menu5();
                    cin >> n;
                }
            }
            cout << "返回到主程式中" << endl;
            break;
        }
        default:
        {
            dddd = 0;
            break;
        }
        }
        if (dddd == 0)
            flag = 0;
        else
        {
            menu();
            cin >> flag;
        }
    }
    return 0;
}
View Code

相關文章