题目链接:https://www.tyvj.cn/Problem_Show.aspx?id=1018

范围只有20,在long long Int范围内。

 1 #include <cstdio>
 2 #include <cstring>
 3 #include <cmath>
 4 using namespace std;
 5 int main(void)
 6 {
 7     freopen("in1.txt", "r", stdin);
 8     int n, k, h, a[10]; long long int s=1; scanf("%d%d",&n,&k); h=k;
 9     for(int i=1;i<=n;++i)s*=i;
10     while (s%10==0) s/=10;
11     while (k--) if(s) a[k]=s%10,s/=10; else break;
12     for (int i=k+1;i<=h-1;++i)printf("%d",a[i]);printf("\n");
13     return 0;
14 }

=_=

相关文章:

  • 2021-11-17
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2022-02-10
  • 2021-12-09
  • 2021-08-12
  • 2021-12-25
  • 2022-02-16
相关资源
相似解决方案