import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); BigInteger sum=BigInteger.ONE; BigInteger ten=new BigInteger("10"); for (int i = 2; i <=n; i++) { sum=sum.multiply(new BigInteger(i+"")); while(sum.remainder(ten).compareTo(BigInteger.ZERO)==0) sum=sum.divide(ten); } String s=sum.toString(); int len=s.length(); String str=""; if(len<k){ str=s; } else{ str+=s.substring(s.length()-k,s.length()); } System.out.println(str); sc.close(); } }
0.0分
0 人评分
大神老白 (C语言代码)浏览:611 |
c primer plus 第十二章 12.1小节浏览:377 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:968 |
最长单词 (C语言代码)浏览:1376 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:668 |
简单的a+b (C语言代码)浏览:340 |
1025题解浏览:738 |
关于float,double变量的几点说明浏览:1810 |
数组与指针的问题浏览:717 |
C二级辅导-统计字符 (C语言代码)浏览:480 |