hdoj--1018--Big Number(简单数学)
Big Number
digits in the factorial of the number.
2
10
20
7
19
//#include<stdio.h>
//#include<string.h>
//int main()
//{
// int t;
// scanf("%d",&t);
// int n,num[200];
// while(t--)
// {
// memset(num,0,sizeof(num));
// num[0]=1;
// scanf("%d",&n);
// int j;
// int c=0;
// for(int i=1;i<=n;i++)
// {
// for(j=0;j<=199;j++)
// {
// num[j]=num[j]*i+c;
// if(num[j]>=10)
// {
// c=num[j]/10;
// num[j]-=c*10;
// }
// else c=0;
// }
//
// }
// for(j=199;j>=0;j--)
// if(num[j]!=0)
// break;
// printf("%d\n",j+1);
// }
// return 0;
//}
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
double ans=0;
for(int i=1;i<=n;i++)
ans+=log10(i);
printf("%d\n",(int)ans+1);
}
return 0;
}
hdoj--1018--Big Number(简单数学)的更多相关文章
- HDOJ 1018 Big Number(大数位数公式)
Problem Description In many applications very large integers numbers are required. Some of these app ...
- 计蒜客 31452 - Supreme Number - [简单数学][2018ICPC沈阳网络预赛K题]
题目链接:https://nanti.jisuanke.com/t/31452 A prime number (or a prime) is a natural number greater than ...
- SDUT 3258 Square Number 简单数学
和上一题一样,把平方因子除去,然后对应的数就变成固定的 #include <cstdio> #include <iostream> #include <algorithm ...
- SDUT 3257 Cube Number 简单数学
把所有数的立方因子除去,那么一个数可以和它组成立方的数是确定的,统计就行 #include <cstdio> #include <iostream> #include < ...
- HDU 5073 Galaxy (2014 Anshan D简单数学)
HDU 5073 Galaxy (2014 Anshan D简单数学) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5073 Description G ...
- HDOJ 1501 Zipper 【简单DP】
HDOJ 1501 Zipper [简单DP] Problem Description Given three strings, you are to determine whether the th ...
- 水题 HDOJ 4727 The Number Off of FFF
题目传送门 /* 水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错 */ #include <cstdio> #include <iostream> ...
- 洛谷试炼场-简单数学问题-P1403 [AHOI2005]-因数
洛谷试炼场-简单数学问题 P1403 [AHOI2005]约数研究 Description 科学家们在Samuel星球上的探险得到了丰富的能源储备,这使得空间站中大型计算机"Samuel I ...
- 洛谷试炼场-简单数学问题-P1045 麦森数-高精度快速幂
洛谷试炼场-简单数学问题 B--P1045 麦森数 Description 形如2^P−1的素数称为麦森数,这时P一定也是个素数.但反过来不一定,即如果PP是个素数,2^P-1 不一定也是素数.到19 ...
随机推荐
- mysql和eclipse连接jdbc驱动配置
环境Windows10 eclipse 64位 MySQL 一:资料准备 (MySQL,eclipse下载安装不在赘述) 配置好MySQL环境后 下载jdbc地址http://dev.mysql.co ...
- 当接口上配了 FeignClient 和 RequestMapping 两个注解,结果错误提示 重复mapping处理方法
再接手老文档的时候,发现有这么一个问题 错误显示为: 原文档写法: 解决方法: 这是一个编译时写法的问题,将上方的RequestMapping去掉,然后把路径放在下面的PostMapping 便可以正 ...
- MFC知识点总结
一:消息1.什么是消息?消息是驱动windows系统运行的基础.从计算机的角度来看,消息就是一个整数. (1)一个无符号整数,是消息值: (2)消息附带的WPARAM和LPARAM类型的参 ...
- Online ML那点事>-
一:译自wiki: KeyWord:标签反馈; Survey: online machine learning is a model of induction that learns one i ...
- vue组件之间互相传值:父传子,子传父
今看到一篇很不错的vue组件传值文章,便于理解,遂做笔记- 一般页面的视图App.vue应为这样 一.父组件向子组件传值 1.创建子组件,在src/components/文件夹下新建一个Child.v ...
- 原生sql的各种问题
1.nutz有方法自动根据数据库建models吗?2.select * from a a没有建相应的models怎么取结果?3.可以直接操作result,而不是在callback里面设置吗? wend ...
- sql语句参数化问题
select @PageSize * from tets SELECT 在WHERE 之前都不能参数化. TOP 只能做字符串运行.
- 软件神器系列——photozoom图片像无损清晰放大软件砸金蛋活动开始啦!
不管是刚进入社会的小白,还是混迹多年的油条,是不是发现了最近的工作越来越难做了? 推广文章.产品手册.营销方案.培训计划.工作报告乃至于PPT,都不是以前用文字数据可以交工的了,现在都讲究“图文并茂” ...
- Debian 6 , 十个串口为什么只识别到了 6个 剩下4 个被禁止了
0.946441] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled [ 0.946533] serial8250: ttyS0 a ...
- vc++如何创建程序-函数的重载
重载构成的条件:函数的参数类型,参数个数不同,才能构成函数的重载 函数重载分为两种情况: 1 .(1)void output(); (2)int output(); 2 .(1)void output ...