
주어진 코드 #include #include #include int solution(int usage) { int answer = 0; if (usage > 30) answer = 20 * 430 + 10 * 570 + (usage - 20) * 840; else if (usage > 20) answer = 20 * 430 + (usage - 20) * 570; else answer = usage * 430; return answer; } int main() { int usage = 35; int ret = solution(usage); printf("solution 함수의 반환 값은 %d 입니다.\n", ret); } 예시 usage return 35 26900 코드 문제점 if (usage > 30)..

주어진 코드 #include #include #include int solution(int stuffs[], int stuffs_len) { int answer = 0; int small_counter = 0; int general_counter = 0; for (int i = 0; i 3) general_counter += stuffs[i]; else small_counter += stuffs[i]; } if (small_counter < general_counter) answer = small_counter; else answer = general_counter; return answer; } int main() { int stuffs..

주어진 코드 #include #include #include int solution(int korean, int english) { int answer = 0; int math = 210 - korean + english; if (math > 100) answer = -1; else answer = math; return answer; } int main() { int korean = 70; int english = 60; int ret = solution(korean, english); printf("solution 함수의 반환 값은 %d 입니다.\n", ret); } 주어진 코드 결과 korean english return 70 60 80 코드 문제점 int math = 210 - korean + e..

주어진 코드 #include #include #include int solution(int taekwondo, int running, int shooting[], int shooting_len) { int answer = 0; if (taekwondo >= 25) answer += 빈칸 ; else answer += taekwondo * 8; answer += 250 + (60 - running) * 5; int count = 0; for (int i = 0; i = 7) answer += 빈칸 ; return answer; } int main..

주어진 코드 #include #include #include int solution(int ladders[][2], int ladders_len, int win) { int answer = 0; int player[6] = { 1, 2, 3, 4, 5, 6 }; for (int i = 0; i < ladders_len; i++) { int temp = player[ladders[i][0] - 1]; //빈칸 = temp;//빈칸 } answer = player[win - 1]; return answer; } int main() { int ladders[5][2] = { {1, 2}, {3, 4}, {2, 3}, {4, 5}, {5, 6} }; int ladders_len = 5; int win = 3; ..

주어진 코드 #include #include #include int func_a(int time_table[], int time_table_len) { int answer = 0; for (int i = time_table_len - 1; i >= 0; i--) { if (time_table[i] == 1) { answer = i; break; } } return answer; } int func_b(int time_table[], int class1, int class2) { int answer = 0; for (int i = class1; i < class2; i++) if (time_table[i] == 0) answer++; return answer; } int func_c(int time_tab..

주어진 코드 #include #include #include int solution(int height[][4], int height_len) { int count = 0; //빈칸 return count; } int main() { int height[4][4] = { {3, 6, 2, 8}, {7, 3, 4, 2}, {8, 6, 7, 3}, {5, 3, 2, 9} }; int height_len = 4; int ret = solution(height, height_len = 4); printf("solution 함수의 반환 값은 %d 입니다.\n", ret); } 완성 코드 #include #include #include int solution(int height[][4], int height_len..
- Java
- 연습문제
- lv1
- 구름에듀 기출문제
- YBM기출
- YBM
- C
- 1급
- Cos Pro
- 자바
- 배열
- CosPro
- cospro기출
- c언어 기출문제
- 구름에듀
- 프로그래머스
- c언어
- COSPRO 2급
- groomedu
- 기출문제
- groom
- 구름 기출문제
- lv2
- C++
- 코스프로
- 배열활용문제
- 알고리즘
- programmers
- 코딩테스트
- cospro기출문제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |