백준

백준 10872번 문제 팩토리얼 (Java)

gxxgsta 2021. 4. 17. 11:29
반응형
SMALL

 

package factorial;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int a=1;
		
		for(int i=1; i<=N; i++) {
			a=a*i;
		}
		System.out.println(a);

	}

}
반응형
LIST