当前位置:网站首页>1217 supermarket coin processor
1217 supermarket coin processor
2022-07-02 01:33:00 【Zhanglilong 666】
Title Description
A coin processor is placed in front of the supermarket , It can help you change your change into a deposit slip . in application , The machine will have a corresponding device to automatically recognize and calculate the amount of your change , But now we can only do a small simulation experiment , Enter the number of each coin by yourself , Then write a program to convert it into a deposit slip .
Input requirements
Input in sequence 1 element 、5 horn 、1 The number of Dimes . Suppose you enter three integers 3 10 25, It means there is 3 individual 1 Yuan coins 、10 individual 5 Dimes and 25 individual 1 Dimes .
Output requirements
Output deposit receipt amount , Such as the input of the above example , Output is
Dollars=10
Change=50
Indicates that the integer amount on the certificate of deposit is 10 element , The change amount is 50 branch .
I.e. requirement Dollars It's shown after that ** Yuan's information ,Change What follows is ** Sub information .
sample input
3 0 10
sample output
Dollars=4 Change=0
#include<cstdio>
int main()
{
int x,y,z;
scanf("%d%d%d",&x,&y,&z);
int sum=x*10+5*y+1*z;
if(sum%10==0){
printf("Dollars=%d\nChange=%d\n",sum/10,0);
}
else
{
printf("Dollars=%d\nChange=%d\n",sum/10,(sum%10)*10);
}
}边栏推荐
- Leetcode 45 Jumping game II (2022.02.14)
- Docker安装Oracle_11g
- Altium designer measure distance (ctrl+m)
- MySQL winter vacation self-study 2022 12 (4)
- 迁移云计算工作负载的四个基本策略
- GL Studio 5 安装与体验
- 6-3漏洞利用-SSH环境搭建
- Modeling essays series 124 a simple coding method
- Matlab uses audioread and sound to read and play WAV files
- Based on Simulink and FlightGear, the dynamic control of multi rotor UAV in equilibrium is modeled and simulated
猜你喜欢

GL Studio 5 安装与体验

6-3漏洞利用-SSH环境搭建

Introduction to ffmpeg Lib

Matlab uses audioread and sound to read and play WAV files

Leetcode, 3 repeatless longest subsequence

城市选择器组件实现原理

Four basic strategies for migrating cloud computing workloads

Using tabbar in wechat applet

Since I understand the idea of dynamic planning, I have opened the door to a new world

Appium inspector can directly locate the WebView page. Does anyone know the principle
随机推荐
企业应该选择无服务器计算吗?
城市选择器组件实现原理
Exclusive delivery of secret script move disassembly (the first time)
Shell Function
Load and domcontentloaded in JS
uTools
Should enterprises choose server free computing?
[WesternCTF2018]shrine writeup
[Obsidian] wechat is sent to Obsidian using remotely save S3 compatibility
[image enhancement] vascular image enhancement based on frangi filter with matlab code
Pyldavis installation and use | attributeerror: module 'pyldavis' has no attribute' gensim '| visual results are exported as separate web pages
卷積神經網絡(包含代碼與相應圖解)
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
MySQL winter vacation self-study 2022 12 (4)
【疾病检测】基于BP神经网络实现肺癌检测系统含GUI界面
Design and implementation of radio energy transmission system
关于ASP.NET CORE使用DateTime日期类型参数的一个小细节
Docker安装Oracle_11g
Hcip day 14 (MPLS protocol)
学习笔记25--多传感器前融合技术