#include "../CookHeader.h"

Array <Array <string>> scoreAry = { { "선미", "88" }, { "초아", "99" }, { "화사", "71" }, { "영탁", "78" }, { "영웅", "67" }, { "민호", "92" } };

Array <Array <string>> scoreSort(Array <Array <string>>  ary) {
		int n = len(ary);
		for (int end = 1; end < n; end++) {
			for (int cur = end; cur > 0; cur--) {
				if (stoi(ary[cur - 1][1]) > stoi(ary[cur][1])) {
					Array <string> tmp = ary[cur - 1];
					ary[cur - 1] = ary[cur];
					ary[cur] = tmp;
				}
			}
		}
		return ary;
}

int main() {
	print("정렬 전 -->");
	printArray2(scoreAry);
	scoreAry = scoreSort(scoreAry);
	print("정렬 후 -->");
	printArray2(scoreAry);
	println("## 성적별 조 편성표 ##");
	int n = len(scoreAry);
	for (int i = 0; i < n/2; i++)
		println(scoreAry[i][0] + ":" + scoreAry[n-1-i][0]);
}