当前位置:网站首页>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 .
边栏推荐
- Picture storage -- Reference
- JVM easy start-01
- laravel8 beanstalk 使用说明
- Noi OJ 1.2 06: round floating point numbers to zero
- NOI OJ 1.3 20:计算2的幂 C语言
- OpenCloudOS使用snap安装.NET 6
- Unity technical manual - shape sub module - Sprite, spriterenderer and velocity over lifetime
- 数学分析_笔记_第2章:实数与复数
- Implementing Domain Driven Design - using ABP framework - General guidelines
- Mysql 的Innodb引擎和Myisam数据结构和区别
猜你喜欢
随机推荐
What is a good quick development framework like?
How does thymeleaf get the value of the request parameter in the URL?
2021-05-07构造器
Mysql-03.工作中对SQL优化的心得体会
R和RStudio下载安装详细步骤
2021-05-11 abstract class
Unity技术手册 - 生命周期LifetimebyEmitterSpeed-周期内颜色ColorOverLifetime-速度颜色ColorBySpeed
经济小常识
MySQL-01.工作中数据库优化和explain字段知识的总结
新派科技美学、原生物联网操作系统重塑全屋智能
2021-04-16方法重载 传参
文件IO(1)
Nuxt.js spa与ssr的区别
MySQL-02. Understanding of indexes at work
Cool photo album code, happy birthday to the object!
SQL writing problem to calculate the ring ratio of the current month and the previous month
Musk's 18-year-old son petitioned to change his name to sever the father son relationship
File IO (1)
文献综述怎么写 ,一直没头绪写不出来怎么办?
5 login failures, limiting login practice

![[software and system security] heap overflow](/img/ca/1b98bcdf006f90cabf3e90e416f7f2.png)







