当前位置:网站首页>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 .
边栏推荐
- 验证码redis实践总结
- beanstalk 常用方法、说明
- MySQL Basics - Notes
- NOI OJ 1.2 10:Hello, World!的大小 C语言
- 构建信创产业生态,移动云立足全栈自主创新连放大招
- NOI OJ 1.2 整型与布尔型的转换 C语言
- argmax函数笔记-全是细节
- NOI OJ 1.3 04:带余除法 C语言
- Solve the problem that Preview PDF cannot be downloaded
- On shore experience of Chang'an University majoring in transportation in 2023
猜你喜欢
随机推荐
OpenCloudOS使用snap安装.NET 6
解决预览pdf不能下载的问题
R and rstudio download and install detailed steps
NOI OJ 1.3 04:带余除法 C语言
Pycharm installation tutorial, super detailed
搭建一个点歌QQ机器人,另外还能看美女
同花顺推荐么?手机开户安全么?
On shore experience of Chang'an University majoring in transportation in 2023
基于SqlSugar的开发框架循序渐进介绍(9)-- 结合Winform控件实现字段的权限控制
Numerical calculation method
搭建一个QQ机器人叫女友起床
Opencloudos uses snap to install NET 6
NOI OJ 1.2 10:Hello, World!的大小 C语言
Golang 快速上手 (2)
2021-05-12内部类
Unity technical manual - limit velocity over lifetime sub module and inherit velocity sub module
MySQL-02. Understanding of indexes at work
Shengshihaotong enables high-quality development with industrial Digitalization
春招面试经验汇总(技术岗)
Cool photo album code, happy birthday to the object!









