코딩/C언어
-
학급임원 뽑기 (중복X)코딩/C언어 2019. 9. 17. 16:02
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 #include #include void pick( char people[][20], int itemSize, int* bucket, int bucketSize, int k) { //중복 조합 int i, lastIndex, smallest, item; if (k == 0) { for (i = 0; i
-
회장, 부회장 뽑기코딩/C언어 2019. 9. 17. 16:00
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 #include #include void pick(char people[][20], int itemSize, int* bucket, int bucketSize, int k) { //중복 조합 int i, j, lastIndex, smallest, item, flag; if (k == 0) { for (i = 0; i
-
수식 나열코딩/C언어 2019. 9. 17. 15:59
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 #include #include void pick(int itemSize, int* bucket, int bucketSize, int k) { //중복 조합 int i, lastIndex, smallest, item, total = 0; if (k == 0) { for (i = 0; i
-
돈 계산코딩/C언어 2019. 9. 17. 15:47
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 #include #include void pick(int money[], int itemSize, int* bucket, int bucketSize, int k) { int i, lastIndex, smallest, item, total = 0; if (k == 0) { for (i = 0; i
-
미로찾기코딩/C언어 2019. 9. 17. 15:26
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 #include #define WIDTH 10 #define HEIGHT 10 int screen[WIDTH][HEIGHT] = { 0, 0, 0,-1,-1,-1,-1,-1,-1,-1, -1,-1, 0,-1,-1,-1,-1,-1,-1,-1, -1, 0, 0, 0, 0, 0, 0,-1,-1,-1, -1,-1,-1,-1, 0,-1, 0,-1,-1,-1, -1,-1,-1,-1, 0,-1, 0,..
-
받아올림의 개수코딩/C언어 2019. 9. 17. 15:08
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 #include int main(void) { int num, num1, num2, result = 0, i = 0; scanf("%d %d", &num1, &num2); while (num1 > 0 || num2 > 0) { num = num1 % 10 + num2 % 10; if (i == 1) { num++; i = 0; } if (num >= 10) { result++; i = 1; } num1 /= 10; num2 /= 10; } printf("%d", result); } Colored by Color Scripter cs 결과: