当前位置:网站首页>Zzuli:1069 learn from classmate Z
Zzuli:1069 learn from classmate Z
2022-07-02 05:30:00 【Don't explode】
Title Description
Z In order to realize the dream of traveling to Yunnan in the summer vacation , Decide to spend only... Every day in the future 1 element , Every flower k Yuan, you can get 1 element , In limine Z Students have M element , Ask how many days you can last at most .
Input
Input 2 It's an integer M, k,(2 <= k <= M <= 1000).
Output
Output an integer , Express M The number of days that yuan can be consumed .
The sample input Copy
4 3
Sample output Copy
5
#include <stdio.h>
int main()
{
int t=0,n=0,M,k;
scanf("%d%d",&M,&k);
while(M!=0)
{
M-=1;
t++;
n++;
if(n%k==0)
M+=1;
}
printf("%d",t);
return 0;
}
边栏推荐
- Thread pool batch processing data
- brew install * 失败,解决方法
- 6.网络-基础
- ERP management system development and design existing source code
- Win10 copy files, save files... All need administrator permission, solution
- Global and Chinese market of pressure gauges 2022-2028: Research Report on technology, participants, trends, market size and share
- Fabric.js IText 手动设置斜体
- 函数栈帧的创建和销毁
- Fabric.js 精简JSON
- 【pyinstaller】_ get_ sysconfigdata_ name() missing 1 required positional argument: ‘check_ exists‘
猜你喜欢
在线音乐播放器app
Gee series: unit 9 generate sampling data in GEE [random sampling]
Visual Studio导入
Gee series: unit 6 building various remote sensing indexes in Google Earth engine
Gee series: unit 8 time series analysis in Google Earth engine [time series]
Fabric. JS activation input box
Centos8 installation mysql8.0.22 tutorial
LeetCode 241. Design priorities for operational expressions (divide and conquer / mnemonic recursion / dynamic programming)
centos8安裝mysql8.0.22教程
运维工作的“本手、妙手、俗手”
随机推荐
Global and Chinese market of insulin pens 2022-2028: Research Report on technology, participants, trends, market size and share
Gee series: Unit 1 Introduction to Google Earth engine
Fabric.js 自由绘制矩形
H5 jump applet
Php/js cookie sharing across domains
Straighten elements (with transition animation)
Fabric.js 圆形笔刷
idea开发工具常用的插件合集汇总
idea開發工具常用的插件合集匯總
Basic use of form
Global and Chinese market of impact roll 2022-2028: Research Report on technology, participants, trends, market size and share
Ls1046nfs mount file system
Résumé de la collection de plug - ins couramment utilisée dans les outils de développement idea
"Original, excellent and vulgar" in operation and maintenance work
指针使用详解
LeetCode 1175. Prime number arrangement (prime number judgment + Combinatorial Mathematics)
中小型项目手撸过滤器实现认证与授权
Fabric.js 居中元素
Dark horse notes -- map set system
Fabric. JS iText superscript and subscript