当前位置:网站首页>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;
}边栏推荐
- A collection of commonly used plug-ins for idea development tools
- Brew install * failed, solution
- Leetcode 18 problem [sum of four numbers] recursive solution
- Mysql基础---查询(1天学会mysql基础)
- Fabric.js 渐变
- KMP idea and template code
- Disable access to external entities in XML parsing
- Reflection of the soul of the frame (important knowledge)
- Fabric.js 基础笔刷
- Detailed explanation of Pointer use
猜你喜欢

Disable access to external entities in XML parsing

2022-2-14 learning xiangniuke project - section 23, section 5, development login and exit functions

Fabric. JS centered element

centos8安裝mysql8.0.22教程

idea开发工具常用的插件合集汇总
![Gee series: unit 7 remote sensing image classification using GEE [random forest classification]](/img/01/ba9441b7b1efaed85c464316740edb.jpg)
Gee series: unit 7 remote sensing image classification using GEE [random forest classification]

Storage of data

With an amount of $50billion, amd completed the acquisition of Xilinx

"Original, excellent and vulgar" in operation and maintenance work

Fabric.js 居中元素
随机推荐
Fabric. JS 3 APIs to set canvas width and height
【pyinstaller】_get_sysconfigdata_name() missing 1 required positional argument: ‘check_exists‘
Opencv LBP features
Fabric. JS iText sets the color and background color of the specified text
Gee series: Unit 5 remote sensing image preprocessing [GEE grid preprocessing]
Pytorch Basics
Leetcode18题 【四数之和】递归解法
生成二维码
ThreadLocal memory leak
Fabric.js 渐变
Collectors. Groupingby sort
h5跳小程序
Gee series: unit 10 creating a graphical user interface using Google Earth engine [GUI development]
7.1模擬賽總結
ERP management system development and design existing source code
JVM class loading mechanism
brew install * 失败,解决方法
XSS basic content learning (continuous update)
Online English teaching app open source platform (customized)
数据的储存