猿问

如何按好感动来冒泡排序,求大神解答?(C语言)

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <time.h>


int main()

{

    int i;          //循环变量,多次使用

    int count = 5;  //存放当前娘娘的总数

    int currDay = 0;//游戏当前进行到了第几天

    int choice;     //用来存放用户的选择

    int tempCount;  //临时变量,用来存放好感度低于60的个数

    int index = -1; //用来存放删除、查找时的索引

    char name[8];   //用来存放用户输入的姓名

    //姓名数组,最多容纳6个字符串,每个字符串的最大长度为8个字符(英文)

    char names[6][8] = {"西施", "貂蝉", "王昭君", "杨玉环", "赵飞燕"};

    //级别数组,最多容纳5个字符串,每个字符串的最大长度为8个字符(英文)

    char levelNames[5][8] = {"贵人", "嫔妃", "贵妃", "皇贵妃", "皇后"};

    //用来存放每个妃子的等级,与levelNames联用。-1表示未启用

    int level[] = {0, 2, 0, 0, 0, -1};

    //用来存放每个妃子的好感度,-1表示未启用

    int loves[] = {100, 100, 100, 100, 100, -1};

    printf("姓名\t等级\t好感度\n");

    printf("-----------------------\n");

    for(i = 0; i < count; i++){

        printf("%s\t%s\t%d\n", names[i], levelNames[level[i]], loves[i]);


    }

//如何按好感动来冒泡排序

    return 0;

}


正在学习ingC
浏览 810回答 0
0回答

慕斯4360584

QFIOUBBFOHBONFPFVVYIOFBQVCGYMPVVPLHUDQKDMGLBIVVRVEQHKWTPVVLFVWVVLYAKMEOUEBEKRLEUEHHEBXBEWZIPSZSOBFYOLWWMTDDWZMCLUFFCBVBHASLEECILYLBYRAPBRTCFMPZHJVIISSIYNNPVUAULOBNDWTVYYCCPVFFQCEXBHZZMFIACRMTCZFIISOPPCKNHVIUYRKYXNRYEOEHRGVFILOFUGQKKNPPMAWERNKMYUHRICPVOBMYHRFKTDDDPSADTGMKXGQGZGPGJSPVICIYRIRCFISLFIJLLLMTVCFPSQDPPIVQJJJCIBXQNOQQUTNXWZSQRAQQOYEXKOITTQNAJCSVVJZMWDTGTCOOQJBBKXAVXNAQVHIFPYBWHLLUQQKKGRTPAURD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