若有不理解之处欢迎留言--- 给以解答,,这个代码也存在部分bug,但是练习增删改查冒泡的好案例
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "Winmm.lib")
#define MAXDAY 5
#define MAX 6
// PlaySound(TEXT("sounds\\一笑倾城.wav"), NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
int main()
{
int i,j,temp;
int curryDay = 0; //表示当前的天数
int choice;
int count = 5; //记录妃子的人数
int index = -1;
char tempName[20];
char addName[20];
char emperor[20];
char names[MAX][20]={"西施","貂蝉","宝贝","昭君","不知火舞",""};
char level_Name[5][20]={"贵人","嫔妃","平贵妃","皇贵妃","皇后"};
int leves[MAX]={0,2,0,0,0,-1};
int loves[MAX]={100,100,100,100,100,-1};
PlaySound(TEXT("sounds\\选妃.wav"), NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);
scanf("%s",emperor);
printf("<%s>陛下驾临!!万岁万岁万万岁!!!!\n",emperor);
do{
printf("\n***********************************************\n");
printf("1、下旨选妃-------(增加功能)\n");
printf("2、翻拍宠幸-----------(修改功能)\n");
printf("3、打入冷宫----------