当前位置:网站首页>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;
}边栏推荐
- 2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
- npm install卡住与node-npy的各种奇怪报错
- 超简单手机地图开发
- 别再问自己适不适合做软件测试了
- Zhonggan micro sprint technology innovation board: annual revenue of 240million, net loss of 17.82 million, proposed to raise 600million
- 分布式事务(Seata) 四大模式详解
- 动态获取权限
- Luogu p5194 [usaco05dec]scales s solution
- Output student grades
- etcd集群权限管理和账号密码使用
猜你喜欢

tonybot 人形机器人 定距移动 代码编写玩法

Paper sharing: generating playful palettes from images

How to query the baby category of tmall on Taobao

Tiantu investment sprint Hong Kong stocks: asset management scale of 24.9 billion, invested in xiaohongshu and Naixue

Accelerating strategy learning using parallel differentiable simulation

NPM install is stuck with various strange errors of node NPY

使用并行可微模拟加速策略学习

Programming language: the essence of type system

Understand the application scenario and implementation mechanism of differential segment

7-18 finding the single root of polynomial by dichotomy
随机推荐
puzzle(016.3)千丝万缕
亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
数学常数表 by q779
Understand the application scenario and implementation mechanism of differential segment
Solr series of full-text search engines - basic principles of full-text search
Zzuli:1054 monkeys eat peaches
Detailed explanation of four modes of distributed transaction (Seata)
Showmebug entered Tencent conference, opening the era of professional technical interview
Some concepts about agile
【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?
Preliminary summary of structure
Protobuf and grpc
Tonybot humanoid robot starts for the first time 0630
剑指 Offer 28. 对称的二叉树
7-22 tortoise and rabbit race (result oriented)
Zzuli: sum of 1051 square roots
x86汇编语言-从实模式到保护模式 笔记
Zzuli:1041 sum of sequence 2
Zzuli:1055 rabbit reproduction
Tonybot humanoid robot checks the port and corresponds to port 0701