본문 바로가기

Programming/BaekJoon

[C++] 백준 10872번 : 팩토리얼


https://www.acmicpc.net/problem/10872




#include <iostream>

using namespace std;

int main() {

int n;

cin >> n;

long long result=1;

for (int i = 1; i <= n; i++) {

result = result * i;

}

cout << result;

}