题目描述:

源码:

#include"iostream"
using namespace std; int main()
{
int n, digit, carry, tmp;
int a[40000];
while(cin>>n)
{
if(n <= 1)
{
cout<<1<<endl;
}
else
{
a[0] = 1;
digit = 1;
for(int i = 2; i <= n; i++)
{
carry = 0;
for(int j = 0; j < digit; j++)
{
tmp = a[j] * i + carry;
a[j] = tmp % 10;
carry = tmp / 10;
}
while(carry > 0)
{
a[digit] = carry % 10;
digit++;
carry /= 10;
} }
for(int j = digit - 1; j >= 0; j--)
{
cout<<a[j];
}
cout<<endl;
}
}
return 0;
}

  

最新文章

  1. 第一课1、ROS
  2. Asm.Def点大兵
  3. Codeforces Round #272 (Div. 2) D. Dreamoon and Sets (思维 数学 规律)
  4. 分布式网站架构后续:zookeeper技术浅析
  5. 【CSS3】---练习制作导航菜单
  6. 学习记录:浏览器JAVASCRIPT里的WINDOWS,DOCUMNET
  7. 上传头像,界面无跳转,php+js
  8. 过滤HTML
  9. Java经典案例之-“最大公约数和最小公倍数”
  10. 新的表格展示利器 Bootstrap Table Ⅱ
  11. mybatis的搭建和注入spring的方式
  12. HTML知识点总结之div、section标签
  13. 错误问题:OpenGL version to old,GLViewinitWithRect(const stdbasic_stringchar,stdchar_traitschar,stdalloca
  14. java.util.Arrays类详解(源码总结)
  15. TODO 动态执行appium代码,便于修改和调试
  16. Mybatis-generator生成Service和Controller
  17. dos命令:系统命令
  18. 题目1441:人见人爱 A ^ B(二分求幂)
  19. centos LB负载均衡集群 三种模式区别 LVS/NAT 配置 LVS/DR 配置 LVS/DR + keepalived配置 nginx ip_hash 实现长连接 LVS是四层LB 注意down掉网卡的方法 nginx效率没有LVS高 ipvsadm命令集 测试LVS方法 第三十三节课
  20. 【OC底层】一个OC对象占用多少内存?

热门文章

  1. Spark SQL 编程API入门系列之SparkSQL的入口
  2. Centos7 minimal 系列之rabbitmq安装(八)
  3. C# web api 中过滤器的使用
  4. Asp.net mvc中使用配置Unity
  5. sql server 随机生成布尔值
  6. 大话主席(superslide和 touchslide)插件的使用
  7. [ RESTful ] [ API ] 有用的資訊
  8. Redis数据库入门基础,及优缺点介绍
  9. 搭建hadoop、hdfs环境--ubuntu(完全分布式)
  10. 洛谷T44252 线索_分治线段树_思维题