当前位置:网站首页>Noi OJ 1.3 15: apple and bug C language
Noi OJ 1.3 15: apple and bug C language
2022-06-23 10:29:00 【chd44】
describe
You bought a box of n An apple , Unfortunately, there was a bug in the box when I bought it . Every insect x You can eat an apple in an hour , Suppose the insect doesn't eat one apple before eating another , So after y How many complete apples do you have in an hour ?
Input
Enter only one line , Include n,x and y( All are integers ). Input data guarantee y <= n * x.
Output
The output is only one line , The number of apples left
The idea of this question should also bring the idea of seeking remainder into it , Make it clear when to -1.
#include<stdio.h>
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
int d=a-c/b;
int e=c%b;
if(e==0)
printf("%d",d);
else
printf("%d",d-1);
return 0;
}notes : Limited topics , It doesn't need to be considered that the calculation result will be <0 The situation of .
边栏推荐
- 技术创造价值,手把手教你薅羊毛篇
- Nuxt. Differences between JS spa and SSR
- thymeleaf中如何给onclick事件传值的方法
- Successful experience of postgraduate entrance examination in materials and Chemical Engineering (metal) of Beijing University of Aeronautics and Astronautics in 2023
- Implementing Domain Driven Design - using ABP framework - General guidelines
- STM32F1与STM32CubeIDE编程实例-红外寻迹传感器驱动
- Numerical calculation method
- NOI OJ 1.3 05:计算分数的浮点数值 C语言
- Set up a QQ robot for ordering songs, and watch beautiful women
- Solve the problem of invalid audio autoplay
猜你喜欢
随机推荐
Different methods of PivotTable in SQL tutorial
解决预览pdf不能下载的问题
web技术分享| 【高德地图】实现自定义的轨迹回放
NOI OJ 1.4 05:整数大小比较 C语言
2021-04-16数组
JVM简单入门-02
NOI OJ 1.2 整数数据类型存储空间大小
thymeleaf如何取url中请求参数值?
MySQL-02.工作中对索引的理解
Five SQL functions for operation date that must be known in SQL tutorial
2021-05-07封装 继承 super this
Mysql-03. Experience of SQL optimization in work
2021-05-07 package inheritance super this
The second Tencent light · public welfare innovation challenge was launched, and the three competition topics focused on the social value of sustainable development
[day 23] given an array of length N, insert element x into the position specified by the array | array insertion operation 4
搭建一个点歌QQ机器人,另外还能看美女
Several practical software sharing
Noi OJ 1.3 09: circle related computing C language
卧槽,最惊艳的论文神器!
5次登陆失败,限制登录实践









