-
10872번 : 팩토리얼Programming/백준 2021. 5. 5. 17:17
#include <iostream> int Factorial(int n) { if (n == 0 || n == 1) return 1; return n * Factorial(n - 1); } int main(void) { std::cin.tie(NULL); std::cout.tie(NULL); std::cin.sync_with_stdio(false); int N; std::cin >> N; std::cout << Factorial(N) << "\n"; return 0; }
'Programming > 백준' 카테고리의 다른 글
[백준 2798번] : 블랙잭 (0) 2021.07.20 10870번 : 피보나치 수 5 (0) 2021.05.05 4153번 : 직각삼각형 (0) 2021.05.05 3009 : 네 번째 점 (0) 2021.05.05 1085번 : 직사각형에서 탈출 (0) 2021.05.03