2015 ソフトウェア設計及び演習用の班Wiki
15::gr11::リザルト3
取得単位から順位の並び替え
void juni()//PLAYER p[PLAYER_MAX] { int n; char *num[] = {"0.png", "1.png", "2.png", "3.png", "4.png", "5.png", "6.png", "7.png", "8.png"}; char *name[] = {"名前.png", "名前2.png", "名前3.png"}; char *gouhi[] = {"留年.png", "卒業.png"}; int i ,j; CREDIT_PFILENAME swap; for(i=0; i<3; i++){ //game.pnum n = p[i].credit[0] + p[i].credit[1]; //n = 一般と専門の取得単位数 cp[i].credit_sum = n; //各プレイヤーにnを入れる cp[i].pfilename = name[i]; if(n < 20){ cp[i].gouhi = gouhi[0]; } else { cp[i].gouhi = gouhi[1]; } cp[i].credit_10 = num[n / 10]; cp[i].credit_1 = num[n % 10]; //number[PLAYER_MAX - 1] = i; } for(i=0; i<PLAYER_MAX-1; i++){ for(j=i+1; j<PLAYER_MAX; j++) if(cp[i].credit_sum < cp[j].credit_sum){ swap = cp[i]; cp[i] = cp[j]; cp[j] = swap; } } }
最終更新日:2015/07/17 15:34:12