解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class T1968 { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext()){ int n = in.nextInt(),m = in.nextInt(),p = in.nextInt(); long ans = (factor(n)-factor(m))%p; System.out.println(ans); } in.close(); } public static long factor(int n){ long ans = 1; for(int i = 1;i<=n;i++) ans = ans * i; return ans; } }
0.0分
0 人评分