当前位置:网站首页>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、3无重复最长子序列
- MySQL winter vacation self-study 2022 12 (4)
- Android high frequency network interview topic must know and be able to compare Android development environment
- 卷積神經網絡(包含代碼與相應圖解)
- Datawhale community blackboard newspaper (issue 1)
- Matlab uses audiorecorder and recordblocking to record sound, play to play sound, and audiobook to save sound
- 微信小程序中使用tabBar
- ES6 new method of string
- A problem about function template specialization
猜你喜欢
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation
Learning notes 25 - multi sensor front fusion technology
Exclusive delivery of secret script move disassembly (the first time)
Introduction to ffmpeg Lib
[rust web rokcet Series 2] connect the database and add, delete, modify and check curd
Sql--- related transactions
三分钟学会基础k线图知识
Learning note 3 -- Key Technologies of high-precision map (Part 1)
学习笔记25--多传感器前融合技术
6-2漏洞利用-ftp不可避免的问题
随机推荐
Basic usage of shell script
MPLS experiment operation
学习笔记25--多传感器前融合技术
Design and implementation of radio energy transmission system
uTools
Basic number theory -- Gauss elimination
三分钟学会基础k线图知识
Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
Liteos learning - first knowledge of development environment
Since I understand the idea of dynamic planning, I have opened the door to a new world
笔者更加愿意将产业互联网看成是一个比消费互联网要丰富得多的概念
[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games
Introduction to ffmpeg Lib
站在新的角度来看待产业互联网,并且去寻求产业互联网的正确方式和方法
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
Hcip day 14 (MPLS protocol)
10 minutes to get started quickly composition API (setup syntax sugar writing method)
The role of artificial intelligence in network security
Shell Function
[IVX junior engineer training course 10 papers] 05 canvas and aircraft war game production