阶乘
来源:互联网 发布:数据库的逻辑模型 编辑:程序博客网 时间:2024/04/28 09:49
// 阶乘.cpp : 定义控制台应用程序的入口点。////#include "stdafx.h"#include<iostream>#include<cstdio>using namespace std;#define Mod 100000//int _tmain(int argc, _TCHAR* argv[])int main(){int n, m, Case;cin >> Case;while( Case-- ){cin >> n >> m;long long ans = 1;for( int i = n; i >= 2; --i ){ans *= i;while( ans % 10 == 0 ){ans /= 10;}ans %= Mod;}//cout << ans << endl;for( int i = 0; i < m - 1; ++i ){ans /= 10;}ans = ans % 10;cout << ans << endl;}return 0;}
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- 阶乘
- An association from the table student refers to an unmapped class: com.test.model.Team
- hibernate一对一主键关联_单向
- Matlab基本函数-floor函数
- Ubuntu 16.10下为Firefox安装Adobe Flash Player
- 长春理工大学 2013年下学期校赛题解 && CUST
- 阶乘
- Codeblocks和gdb调试
- 黑马程序员_毕向东_Java基础视频教程学习笔记(十五)
- 跳跃表
- 高扩展的基于NIO的服务器架构(二)
- sitemesh 简单实例
- git使用时出现的问题
- hdu 4781 Assignment For Princess (2013ACMICPC 成都站 A)
- tcp/ip的一些协议名词 (收集)