:: ADVANCE ::
dovelet 9단계 재귀 뒤집어 더하기 (radd) http://59.23.113.171/30stair/radd/radd.php?pname=radd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #include int radd(int n) { int temp = 0; while (n) { temp = temp * 10 + n % 10; n /= 10; } return temp; } int main(void) { int n, m; scanf("%d%d", &n, &m); printf("%d\n", radd(radd(n) + radd(m))); return 0; } cs
dovelet 9 단계 재귀 네 수의 합 (hap) http://59.23.113.171/30stair/hap/hap.php?pname=hap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include int hap(int a, int b) { return a + b; } int main(void) { int num[4], i; for (i = 0; i
dovelet 9 단계 재귀 big dance (dance) http://59.23.113.171/30stair/dance/dance.php?pname=dance 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 #include int sum; void dance(int start, int end, int n) { int temp; if (start == end-1) { sum += start * end; return; } if (start == end) return; temp = start + (n - 1) / 2; dance(start, temp, temp - start + 1); temp += 1; ..