当前位置:网站首页>Zzuli:1058 solving inequalities
Zzuli:1058 solving inequalities
2022-07-03 14:35:00 【Snake_____】
Title Description
Known inequality 1!+2!+3!+...+m!‹n, Please program the user specified n The value is calculated and the result satisfying the inequality is output m The integer solution of .
Input
Enter an integer n,n by int Positive integer in range .
Output
Output m Value range of , See the output sample for the specific format .
The sample input Copy
2000000000
Sample output Copy
m<=12
Tips
Note the type overflow problem in the calculation process
#include <stdio.h>
int main()
{
int n,i,mul=1;
scanf("%d",&n);
double sum=0;
for(i=1;;i++)
{
mul=i*mul;
sum=sum+mul;
if(sum>=n)
{
printf("m<=%d",i-1);
break;}
}
return 0;
}
边栏推荐
- Selective sorting
- Common commands for getting started with mongodb database
- Sub GHz wireless solution Z-Wave 800 Series zg23 SOC and zgm230s modules
- Sub-GHz无线解决方案Z-Wave 800 系列ZG23 soc和ZGM230S模块
- Solr series of full-text search engines - basic principles of full-text search
- Etcd cluster permission management and account password usage
- Analysis of gene family characteristics - chromosome location analysis
- Use of constraintlayout
- npm install卡住与node-npy的各种奇怪报错
- Stop asking yourself if you are suitable for software testing
猜你喜欢
How to query the baby category of tmall on Taobao
tonybot 人形機器人 紅外遙控玩法 0630
如何查询淘宝天猫的宝贝类目
Tonybot humanoid robot starts for the first time 0630
Sub GHz wireless solution Z-Wave 800 Series zg23 SOC and zgm230s modules
Four data flows and cases of grpc
天谋科技 Timecho 完成近亿元人民币天使轮融资,打造工业物联网原生时序数据库
Doris学习笔记之数据表的创建
dllexport和dllimport
Protobuf and grpc
随机推荐
Raft agreement
Zhonggan micro sprint technology innovation board: annual revenue of 240million, net loss of 17.82 million, proposed to raise 600million
天谋科技 Timecho 完成近亿元人民币天使轮融资,打造工业物联网原生时序数据库
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
Luogu p5194 [usaco05dec]scales s solution
别再问自己适不适合做软件测试了
Zzuli:1046 product of odd numbers
Jiuyi cloud black free encryption free version source code
洛谷P5536 【XR-3】核心城市 题解
The mail function of LNMP environment cannot send mail
Zzuli: cumulative sum of 1050 factorials
retrofit
Too many files with unapproved license
7-1 positive integer a+b (15 points)
论文分享:Generating Playful Palettes from Images
Find the sum of the elements of each row of the matrix
【7.3】146. LRU缓存机制
tonybot 人形機器人 紅外遙控玩法 0630
Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
剑指 Offer 28. 对称的二叉树