티스토리 뷰
C++ 스타일
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | #include <stdio.h> #include <string.h> // memcpy() #include <Windows.h> // system() #include <conio.h> // _getch() #define NAME_SIZE 20 #define SAMPLE_SIZE 25 #define MAX_SIZE 100 #define ENTER 13 typedef enum POSITION { EMPTY = 0, TOP = 1, JG = 2, MID = 3, AD = 4, SUP = 5 } POSITION; typedef struct CHAMPION { char name[NAME_SIZE]; int hp, mp, speed, range; POSITION position; } CHAMPION; int list_view(void); void all_empty(CHAMPION list[], int i); CHAMPION *init_sample(void); int name_check(CHAMPION list[], int j, char strs[]); int find_max(CHAMPION list[], int j, int Max); void Search(CHAMPION list[], int i, char search[]); // 1. Search void Insert(CHAMPION list[], int i); // 2. Insert void Delete(CHAMPION list[], int i, char search[]); // 3. Delete void DeleteAll(CHAMPION list[], int i, int target); // 4. DeleteAll(position) void PrintAll(CHAMPION list[], int i); // 5. PrintAll void FindMaxHp(CHAMPION list[], int i); // 6. FindMaxHP void SortByHp(CHAMPION list[]); // 7. SortByHp int main() { CHAMPION list[MAX_SIZE]; all_empty(list, 0); memcpy(list, init_sample(), sizeof(CHAMPION)*MAX_SIZE); int select; while ((select = list_view()) != 8) // 8. Exit { while (getchar() != '\n'); // 버퍼 비우기, fflush 먹통일 때 사용 system("cls"); if (select == 1) { // 1. Search char search[NAME_SIZE]; printf("Search : "); gets_s(search, sizeof(char)*NAME_SIZE); system("cls"); Search(list, 0, search); } else if (select == 2) { // 2. Insert Insert(list, 0); } else if (select == 3) { // 3. Delete char search[NAME_SIZE]; printf("Search : "); gets_s(search, sizeof(char)*NAME_SIZE); system("cls"); Delete(list, 0, search); } else if (select == 4) { // 4. DeleteAll(position) int delete_position; printf("Search : "); scanf("%d", &delete_position); system("cls"); DeleteAll(list, 0, delete_position); } else if (select == 5) { // 5. PrintAll PrintAll(list, 0); } else if (select == 6) { // 6. FindMaxHp FindMaxHp(list, 0); } else if (select == 7) { // 7. SortByHp SortByHp(list); } else { // 예외 처리 } } return 0; } int list_view(void) { int choice = 0; printf("Select Menu\n"); printf("---------------------------\n"); printf("1. Search\n"); printf("2. Insert\n"); printf("3. Delete\n"); printf("4. DeleteAll(position)\n"); printf("5. PrintAll\n"); printf("6. FindMaxHp\n"); printf("7. SortByHp\n"); printf("8. Exit\n"); printf("---------------------------\n"); printf("Enter number : "); scanf("%d", &choice); return choice; } void all_empty(CHAMPION list[], int i) { if (i < MAX_SIZE) { memcpy((list + i)->name, "\0", sizeof(NAME_SIZE)); (list + i)->hp = 0; (list + i)->mp = 0; (list + i)->speed = 0; (list + i)->range = 0; (list + i)->position = EMPTY; return all_empty(list, i + 1); } } CHAMPION *init_sample(void) { CHAMPION champion_sample[MAX_SIZE] = { { "가렌", 495, 100, 75, 50, TOP }, { "요릭", 475, 140, 50, 50, TOP }, { "초가스", 675, 70, 50, 60, JG }, { "카시오페아", 335, 295, 55, 375, MID }, { "칼리스타", 295, 120, 60, 375, AD }, { "케인", 350, 110, 50, 50, JG }, { "퀸", 275, 150, 100, 405, AD }, { "트위스티드 페이트",310, 35, 55, 375, MID }, { "하이머딩거", 385, 25, 60, 375, TOP }, { "갈리오", 325, 75, 50, 50, MID }, { "갱플랭크", 330, 100, 50, 50, TOP }, { "그라가스", 335, 95, 50, 2, JG }, { "그레이브즈", 340, 90, 100, 50, JG }, { "나르", 345, 100, 85, 105, TOP }, { "나미", 100, 100, 80, 65, SUP }, { "나서스", 355, 100, 75, 70, TOP }, { "노틸러스", 360, 70, 50, 75, TOP }, { "녹턴", 365, 65, 50, 55, JG }, { "누누", 675, 60, 50, 45, SUP }, { "니달리", 375, 55, 70, 55, JG }, { "다리우스", 380, 50, 80, 60, TOP }, { "다이애나", 385, 45, 90, 65, MID }, { "드레이븐", 390, 40, 100, 70, AD }, { "라이즈", 400, 35, 105, 40, MID }, { "라칸", 200, 30, 110, 30, SUP } }; return champion_sample; } int name_check(CHAMPION list[], int j, char strs[]) { if (j < MAX_SIZE) { if (strcmp((list + j)->name, strs) == 0) { return 0; } else { return name_check(list, j + 1, strs); } } else { return 1; } } void insert_champion(CHAMPION *target, CHAMPION *copy) { memcpy(target, copy, sizeof(CHAMPION)); } int find_max(CHAMPION list[], int j,int Max) { if (j < MAX_SIZE) { if ((list + j)->hp > Max) { Max = (list + j)->hp; return find_max(list, j + 1, Max); } else { return find_max(list, j + 1, Max); } } return Max; } int *insert_HP(CHAMPION list[], int HP_arr[], int i) { if (i < MAX_SIZE) { *(HP_arr + i) = (list + i)->hp; return insert_HP(list, HP_arr, i + 1); } return HP_arr; } void HP_rev(int HP_arr[]) { int i = 0, j = 0; int new_arr[MAX_SIZE]; memcpy(new_arr, HP_arr, sizeof(int)*MAX_SIZE); for (int i = 0; i < MAX_SIZE; i++) { for (int j = 1; j < MAX_SIZE; j++) { if (i == j) { continue; } if (new_arr[j-1] < new_arr[j]) { // n+1이 n보다 작으면, n이 더 크면 int p = new_arr[j - 1]; new_arr[j - 1] = new_arr[j]; new_arr[j] = p; } } } memcpy(HP_arr, new_arr, sizeof(int)*MAX_SIZE); } CHAMPION *find_HP(CHAMPION list[], int target_HP, int i) { if (i < MAX_SIZE) { if ((list + i)->hp == target_HP) { (list + i)->hp = 0; return (list + i); } return find_HP(list, target_HP, i + 1); } return NULL; } void full_sample(CHAMPION list[], CHAMPION sample[], int HP_arr[], int i) { // list는 원본, sample은 정리본 if (i < MAX_SIZE) { insert_champion(sample+i, find_HP(list, HP_arr[i], 0)); (sample + i)->hp = HP_arr[i]; return full_sample(list, sample, HP_arr, i + 1); } memcpy(list, sample, sizeof(CHAMPION)*MAX_SIZE); } void Search(CHAMPION list[], int i, char search[]) { // 1. Search if (i < MAX_SIZE) { if (strcmp((list + i)->name, search) == 0) { printf("name : %-20s, hp : %3d,\t mp : %3d,\t speed : %3d,\t range : %3d,\t position : %d\n", (list + i)->name, (list + i)->hp, (list + i)->mp, (list + i)->speed, (list + i)->range, (list + i)->position); } else { return Search(list, i + 1, search); } } char exit = 0; printf("Enter"); do { exit = _getch(); } while (exit != 13); system("cls"); } void Insert(CHAMPION list[], int i) { // 2. Insert CHAMPION data; if (i < MAX_SIZE) { if ((list + i)->hp == 0) { printf("name : "); gets_s(data.name, sizeof(char)*NAME_SIZE); if (name_check(list, 0, data.name)) { printf("hp : "); scanf("%d", &data.hp); printf("mp : "); scanf("%d", &data.mp); printf("speed : "); scanf("%d", &data.speed); printf("range : "); scanf("%d", &data.range); int input; do { printf("position : "); scanf("%d", &input); switch (input) { case 1: data.position = TOP; break; case 2: data.position = JG; break; case 3: data.position = MID; break; case 4: data.position = AD; break; case 5: data.position = SUP; break; default: printf("Input error\n"); } } while (input < 1 && input > 5); insert_champion(list + i, &data); system("cls"); } else { system("cls"); } } else { return Insert(list, i + 1); } } } void Delete(CHAMPION list[], int i, char search[]) { // 3. Delete if (i < MAX_SIZE) { if (strcmp((list + i)->name, search) == 0) { CHAMPION empty_data = { "/0", 0, 0, 0, 0, EMPTY }; insert_champion(list + i, &empty_data); } else { return Delete(list, i + 1, search); } } } void DeleteAll(CHAMPION list[], int i, int target) { // 4. DeleteAll if (i < MAX_SIZE) { if ((list + i)->position == target) { CHAMPION empty_data = { "/0", 0, 0, 0, 0, EMPTY }; insert_champion(list + i, &empty_data); return DeleteAll(list, i + 1, target); } else { return DeleteAll(list, i + 1, target); } } system("cls"); } void PrintAll(CHAMPION list[], int i) { // 5. PrintAll if (i < MAX_SIZE) { if ((list + i)->hp != 0) { printf("name : %-20s, hp : %3d,\t mp : %3d,\t speed : %3d,\t range : %3d,\t position : %d\n", (list + i)->name, (list + i)->hp, (list + i)->mp, (list + i)->speed, (list + i)->range, (list + i)->position); } return PrintAll(list, i + 1); } char exit = 0; printf("Enter"); do { exit = _getch(); } while (exit != 13); system("cls"); } void FindMaxHp(CHAMPION list[], int i) { // 6. FindMaxHp if (i < MAX_SIZE) { if ((list + i)->hp == find_max(list, 0, 0)) { printf("name : %-20s, hp : %3d,\t mp : %3d,\t speed : %3d,\t range : %3d,\t position : %d\n", (list + i)->name, (list + i)->hp, (list + i)->mp, (list + i)->speed, (list + i)->range, (list + i)->position); return FindMaxHp(list, i + 1); } else { return FindMaxHp(list, i + 1); } } char exit = 0; printf("Enter"); do { exit = _getch(); } while (exit != 13); system("cls"); } void SortByHp(CHAMPION list[]) { // 7. SortByHp int HP_arr[MAX_SIZE]; memcpy(HP_arr, insert_HP(list, HP_arr, 0), sizeof(int)*MAX_SIZE); HP_rev(HP_arr); CHAMPION sample[MAX_SIZE]; full_sample(list, sample, HP_arr, 0); } | cs |
C 스타일
c언어에서는 void형 재귀함수에서 return 경고가 발생하므로 이와같이 0으로 리턴하여 사용합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | #include <stdio.h> #include <string.h> // memcpy() #include <Windows.h> // system() #include <conio.h> // _getch() #define NAME_SIZE 20 #define SAMPLE_SIZE 25 #define MAX_SIZE 100 #define ENTER 13 typedef enum POSITION { EMPTY = 0, TOP = 1, JG = 2, MID = 3, AD = 4, SUP = 5 } POSITION; typedef struct CHAMPION { char name[NAME_SIZE]; int hp, mp, speed, range; POSITION position; } CHAMPION; int list_view(void); int all_empty(CHAMPION list[], int i); CHAMPION *init_sample(void); int name_check(CHAMPION list[], int j, char strs[]); int insert_champion(CHAMPION *target, CHAMPION *copy); int find_max(CHAMPION list[], int j, int Max); int *insert_HP(CHAMPION list[], int HP_arr[], int i); int HP_rev(int HP_arr[]); CHAMPION *find_HP(CHAMPION list[], int target_HP, int i); int full_sample(CHAMPION list[], CHAMPION sample[], int HP_arr[], int i); int Search(CHAMPION list[], int i, char search[]); // 1. Search int Insert(CHAMPION list[], int i); // 2. Insert int Delete(CHAMPION list[], int i, char search[]); // 3. Delete int DeleteAll(CHAMPION list[], int i, int target); // 4. DeleteAll(position) int PrintAll(CHAMPION list[], int i); // 5. PrintAll int FindMaxHp(CHAMPION list[], int i); // 6. FindMaxHP int SortByHp(CHAMPION list[]); // 7. SortByHp int main() { CHAMPION list[MAX_SIZE]; all_empty(list, 0); memcpy(list, init_sample(), sizeof(CHAMPION)*MAX_SIZE); int select; while ((select = list_view()) != 8) // 8. Exit { while (getchar() != '\n'); // 버퍼 비우기, fflush 먹통일 때 사용 system("cls"); if (select == 1) { // 1. Search char search[NAME_SIZE]; printf("Search : "); gets_s(search, sizeof(char)*NAME_SIZE); system("cls"); Search(list, 0, search); } else if (select == 2) { // 2. Insert Insert(list, 0); } else if (select == 3) { // 3. Delete char search[NAME_SIZE]; printf("Search : "); gets_s(search, sizeof(char)*NAME_SIZE); system("cls"); Delete(list, 0, search); } else if (select == 4) { // 4. DeleteAll(position) int delete_position; printf("Search : "); scanf("%d", &delete_position); system("cls"); DeleteAll(list, 0, delete_position); } else if (select == 5) { // 5. PrintAll PrintAll(list, 0); } else if (select == 6) { // 6. FindMaxHp FindMaxHp(list, 0); } else if (select == 7) { // 7. SortByHp SortByHp(list); } else { // 예외 처리 } } return 0; } int list_view(void) { int choice = 0; printf("Select Menu\n"); printf("---------------------------\n"); printf("1. Search\n"); printf("2. Insert\n"); printf("3. Delete\n"); printf("4. DeleteAll(position)\n"); printf("5. PrintAll\n"); printf("6. FindMaxHp\n"); printf("7. SortByHp\n"); printf("8. Exit\n"); printf("---------------------------\n"); printf("Enter number : "); scanf("%d", &choice); return choice; } int all_empty(CHAMPION list[], int i) { if (i < MAX_SIZE) { memcpy((list + i)->name, "\0", sizeof(NAME_SIZE)); (list + i)->hp = 0; (list + i)->mp = 0; (list + i)->speed = 0; (list + i)->range = 0; (list + i)->position = EMPTY; return all_empty(list, i + 1); } return 0; } CHAMPION *init_sample(void) { CHAMPION champion_sample[MAX_SIZE] = { { "가렌", 495, 100, 75, 50, TOP }, { "요릭", 475, 140, 50, 50, TOP }, { "초가스", 675, 70, 50, 60, JG }, { "카시오페아", 335, 295, 55, 375, MID }, { "칼리스타", 295, 120, 60, 375, AD }, { "케인", 350, 110, 50, 50, JG }, { "퀸", 275, 150, 100, 405, AD }, { "트위스티드 페이트",310, 35, 55, 375, MID }, { "하이머딩거", 385, 25, 60, 375, TOP }, { "갈리오", 325, 75, 50, 50, MID }, { "갱플랭크", 330, 100, 50, 50, TOP }, { "그라가스", 335, 95, 50, 2, JG }, { "그레이브즈", 340, 90, 100, 50, JG }, { "나르", 345, 100, 85, 105, TOP }, { "나미", 100, 100, 80, 65, SUP }, { "나서스", 355, 100, 75, 70, TOP }, { "노틸러스", 360, 70, 50, 75, TOP }, { "녹턴", 365, 65, 50, 55, JG }, { "누누", 675, 60, 50, 45, SUP }, { "니달리", 375, 55, 70, 55, JG }, { "다리우스", 380, 50, 80, 60, TOP }, { "다이애나", 385, 45, 90, 65, MID }, { "드레이븐", 390, 40, 100, 70, AD }, { "라이즈", 400, 35, 105, 40, MID }, { "라칸", 200, 30, 110, 30, SUP } }; return champion_sample; } int name_check(CHAMPION list[], int j, char strs[]) { if (j < MAX_SIZE) { if (strcmp((list + j)->name, strs) == 0) { return 0; } else { return name_check(list, j + 1, strs); } } else { return 1; } } int insert_champion(CHAMPION *target, CHAMPION *copy) { memcpy(target, copy, sizeof(CHAMPION)); return 0; } int find_max(CHAMPION list[], int j, int Max) { if (j < MAX_SIZE) { if ((list + j)->hp > Max) { Max = (list + j)->hp; return find_max(list, j + 1, Max); } else { return find_max(list, j + 1, Max); } } return Max; } int *insert_HP(CHAMPION list[], int HP_arr[], int i) { if (i < MAX_SIZE) { *(HP_arr + i) = (list + i)->hp; return insert_HP(list, HP_arr, i + 1); } return HP_arr; } int HP_rev(int HP_arr[]) { int i = 0, j = 0; int new_arr[MAX_SIZE]; memcpy(new_arr, HP_arr, sizeof(int)*MAX_SIZE); for (int i = 0; i < MAX_SIZE; i++) { for (int j = 1; j < MAX_SIZE; j++) { if (i == j) { continue; } if (new_arr[j - 1] < new_arr[j]) { // n+1이 n보다 작으면, n이 더 크면 int p = new_arr[j - 1]; new_arr[j - 1] = new_arr[j]; new_arr[j] = p; } } } memcpy(HP_arr, new_arr, sizeof(int)*MAX_SIZE); return 0; } CHAMPION *find_HP(CHAMPION list[], int target_HP, int i) { if (i < MAX_SIZE) { if ((list + i)->hp == target_HP) { (list + i)->hp = 0; return (list + i); } return find_HP(list, target_HP, i + 1); } return NULL; } int full_sample(CHAMPION list[], CHAMPION sample[], int HP_arr[], int i) { // list는 원본, sample은 정리본 if (i < MAX_SIZE) { insert_champion(sample + i, find_HP(list, HP_arr[i], 0)); (sample + i)->hp = HP_arr[i]; return full_sample(list, sample, HP_arr, i + 1); } memcpy(list, sample, sizeof(CHAMPION)*MAX_SIZE); return 0; } int Search(CHAMPION list[], int i, char search[]) { // 1. Search if (i < MAX_SIZE) { if (strcmp((list + i)->name, search) == 0) { printf("name : %-20s, hp : %3d,\t mp : %3d,\t speed : %3d,\t range : %3d,\t position : %d\n", (list + i)->name, (list + i)->hp, (list + i)->mp, (list + i)->speed, (list + i)->range, (list + i)->position); } else { return Search(list, i + 1, search); } } char exit = 0; printf("Enter"); do { exit = _getch(); } while (exit != 13); system("cls"); return 0; } int Insert(CHAMPION list[], int i) { // 2. Insert CHAMPION data; if (i < MAX_SIZE) { if ((list + i)->hp == 0) { printf("name : "); gets_s(data.name, sizeof(char)*NAME_SIZE); if (name_check(list, 0, data.name)) { printf("hp : "); scanf("%d", &data.hp); printf("mp : "); scanf("%d", &data.mp); printf("speed : "); scanf("%d", &data.speed); printf("range : "); scanf("%d", &data.range); int input; do { printf("position : "); scanf("%d", &input); switch (input) { case 1: data.position = TOP; break; case 2: data.position = JG; break; case 3: data.position = MID; break; case 4: data.position = AD; break; case 5: data.position = SUP; break; default: printf("Input error\n"); } } while (input < 1 && input > 5); insert_champion(list + i, &data); system("cls"); } else { system("cls"); } } else { return Insert(list, i + 1); } } return 0; } int Delete(CHAMPION list[], int i, char search[]) { // 3. Delete if (i < MAX_SIZE) { if (strcmp((list + i)->name, search) == 0) { CHAMPION empty_data = { "/0", 0, 0, 0, 0, EMPTY }; insert_champion(list + i, &empty_data); } else { return Delete(list, i + 1, search); } } return 0; } int DeleteAll(CHAMPION list[], int i, int target) { // 4. DeleteAll if (i < MAX_SIZE) { if ((list + i)->position == target) { CHAMPION empty_data = { "/0", 0, 0, 0, 0, EMPTY }; insert_champion(list + i, &empty_data); return DeleteAll(list, i + 1, target); } else { return DeleteAll(list, i + 1, target); } } system("cls"); return 0; } int PrintAll(CHAMPION list[], int i) { // 5. PrintAll if (i < MAX_SIZE) { if ((list + i)->hp != 0) { printf("name : %-20s, hp : %3d,\t mp : %3d,\t speed : %3d,\t range : %3d,\t position : %d\n", (list + i)->name, (list + i)->hp, (list + i)->mp, (list + i)->speed, (list + i)->range, (list + i)->position); } return PrintAll(list, i + 1); } char exit = 0; printf("Enter"); do { exit = _getch(); } while (exit != 13); system("cls"); return 0; } int FindMaxHp(CHAMPION list[], int i) { // 6. FindMaxHp if (i < MAX_SIZE) { if ((list + i)->hp == find_max(list, 0, 0)) { printf("name : %-20s, hp : %3d,\t mp : %3d,\t speed : %3d,\t range : %3d,\t position : %d\n", (list + i)->name, (list + i)->hp, (list + i)->mp, (list + i)->speed, (list + i)->range, (list + i)->position); return FindMaxHp(list, i + 1); } else { return FindMaxHp(list, i + 1); } } char exit = 0; printf("Enter"); do { exit = _getch(); } while (exit != 13); system("cls"); return 0; } int SortByHp(CHAMPION list[]) { // 7. SortByHp int HP_arr[MAX_SIZE]; memcpy(HP_arr, insert_HP(list, HP_arr, 0), sizeof(int)*MAX_SIZE); HP_rev(HP_arr); CHAMPION sample[MAX_SIZE]; full_sample(list, sample, HP_arr, 0); return 0; } | cs |
'프로그래밍 > C' 카테고리의 다른 글
C언어, 한정자 const/volatile/static/extern (0) | 2018.04.20 |
---|---|
[자료구조] 3일차_과제(180323) - 연결리스트 (0) | 2018.03.30 |
[창의적it 프로그래밍] 2차 과제 -동적메모리와 연결리스트- (0) | 2018.03.21 |
[창의적it 프로그래밍] 1차 과제 -포인터- (0) | 2018.03.16 |
[자료구조] 2일차_과제(180316) - 오목 (0) | 2018.03.16 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Next.js
- 이진탐색 #중복
- Angular
- DevOps
- RDBMS
- gcp
- oracle
- PostgreSQL
- aws
- nosql
- Quasar
- alpine.js
- vue.js
- Remix
- Gatsby.js
- node.js
- svelte
- nuxt.js
- MySQL
- REACT
- Azure
- Cloud
- SQLite
- vue
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함