factorial
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <stdio.h> int factorial (int number); int main (int argc, char** argv) { printf ("%d\n", factorial (5)); return 0; } int factorial (int number) { if (number <= 1) return 1; return number * factorial (number - 1); } | cs |
0 개의 댓글:
댓글 쓰기