⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dancermatch.cpp

📁 自己刚刚独立完成的数据结构课程设计舞伴配对系统。(比较简单
💻 CPP
字号:
#include"iostream.h"
#include"stdlib.h"
#include"malloc.h"
#include"stdio.h"
#include"windows.h"
#include"class_partner.h"
#include"related_func.h"

main()
{
 Partner<int> M,F;
 Partner<int> M1,F1;
 system("color f3");
 int x=Menu();
 while(1){
    system("cls");
    switch(x){
        case 1:
        case 2:{
            M.Clear();F.Clear();
            M1.Clear();F1.Clear();
            cout<<"\n\n\t\t\t设定舞伴人数"<<endl;
            cout<<"\n\t\t\t男舞伴:";M.Dancer();M1=M;
            cout<<"\n\t\t\t女舞伴:";F.Dancer();F1=F;
            cout<<"\n\t\t\t设定成功!";
            Sleep(1000);
            break;
         }
        case 3:{
            char ch='Y';
            while(ch=='Y'||ch=='y'){
                system("cls");
                CurrentMatch(M1,F1);
                cout<<"\t\t  ...MUSIC...";
                Sleep(3000);
                system("cls");
                NextMatch(M1,F1);
                Sleep(3000);
                system("cls");
                CurrentMatch(M1,F1);
                cout<<"\t\t  ...MUSIC...";
                Sleep(3000);
                cout<<"\n\n\t\t本曲结束!"<<endl<<endl;
                int min=(M1.DancerNum<F1.DancerNum)?M1.DancerNum:F1.DancerNum;
                M1.MakeNew(min);
                F1.MakeNew(min);
                cout<<"\t\t继续下一曲(Y/N):";
                cin>>ch;
            }
            break;
         }
        case 4:{
            char ch='Y';
            while(ch!='N'&&ch!='n'){
                SearchMatch(M,F);
                cout<<"\n\n\t\t\t继续查询(Y/N):";
                cin>>ch;
                system("cls");
            }
            break;
         }
        case 5:{exit(1);}
        default:{
            cout<<"\n\n\n\t\t\t对不起,该选项不存在!"<<endl;
            Sleep(1000);
            break;
        }
    }
    x=Menu();
 }
}
            
            
            
            
            
            
            
            
            
            


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -