当前位置:网站首页>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 .
边栏推荐
- 构建信创产业生态,移动云立足全栈自主创新连放大招
- Install the typescript environment and enable vscode to automatically monitor the compiled TS file as a JS file
- JVM简单入门-02
- 大作业合集
- The second Tencent light · public welfare innovation challenge was launched, and the three competition topics focused on the social value of sustainable development
- thymeleaf中如何给onclick事件传值的方法
- Golang 快速上手 (3)
- Different methods of PivotTable in SQL tutorial
- Mathematical analysis_ Notes_ Chapter 2: real and plural numbers
- 2021-05-11抽象类
猜你喜欢

Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control

Too helpless! Microsoft stopped selling AI emotion recognition and other technologies, saying frankly: "the law can not keep up with the development of AI"

MySQL Basics - Notes

Stm32f1 and stm32subeide programming example - infrared tracking sensor driver

图片存储--引用

Set up a QQ robot for ordering songs, and watch beautiful women

搭建一个QQ机器人叫女友起床

Numerical calculation method

几款实用软件分享

R和RStudio下载安装详细步骤
随机推荐
NOI OJ 1.3 09:与圆相关的计算 C语言
社招腾讯高P(高级产品经理)的面试手册
argmax函数笔记-全是细节
马斯克 18 岁儿子请愿改名,欲断绝父子关系
2021-05-11instanceof和类型转换
NOI OJ 1.2 整数数据类型存储空间大小
Build the information and innovation industry ecology, and make mobile cloud based on the whole stack of independent innovation
Mysql 的Innodb引擎和Myisam数据结构和区别
Successful experience in postgraduate entrance examination for MTI master of English translation major of Beijing University of science and technology in 2023
验证码redis实践总结
Opencloudos uses snap to install NET 6
Data structures and differences between MySQL InnoDB engine and MyISAM
Pycharm installation tutorial, super detailed
What is JSX in the JS tutorial? Why do we need it?
NOI OJ 1.3 13:反向输出一个三位数 C语言
Spring recruitment interview experience summary (technical post)
Is IPv6 faster than IPv4?
File IO (1)
Bugs encountered in Oracle
炫酷相册代码,祝对象生日快乐!