- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
2521题解题报告
解题报告
题号:2521
题目:How much did the businessman lose
Description
Businessmen, of course, can make much money. However, sometimes, they would lose money in trading. For example, Jame, a businessman, brought in some goods each cost him 40 yuan and he decided to sell at the price of 70 yuan. Then a customer came to buy one, gave Jame 100 yuan, and of course got back 30 yuan. You may said, Jame earned 30 yuan. But unfortunately, Jame found the 100 yuan from the customer was fake. What a poor man! In this case Jame lost 70 yuan (40 (the goods price) + 30 (the money paid back to the customer)). Now your task is to calculate how much Jame would lose in this kind of trade. Of course in this case, sometimes Jame may still earn.
Input
The input consists of several instances. Each instance contains four integers N, M, P and C, which are all in the range [0, 50000], separated by a single space. N is the cost price of Jame good. M is the sell price. P is the total fake money the customer gave Jame. C is how much Jame paid back to the customer. Here N M. And P may be less than M, as customer may pay with some fake money and some true money. The input is terminated by a line containing 4 zeros.
Output
For one instance, output one line contains exactly one integer, which tells how much Jame lost in the trade. If Jame still earned, just output a negative integer, the absolute value of which tells the money Jame earned.
Sample Input
40 70 100 30
40 70 50 20
14604 32391 3902 153
0 0 0 0
Sample Output
70
20
-13885
翻译:商人,当然也可以挣很多钱。但是,有时,他们会失去交易的资金。例如,詹姆,商人,带来了他的一些商品每个成本40元,他决定出售在70元的价格。然后,一个客户来买一个,给了詹姆100元,当然回来30元。您可能会说,“詹姆赚30元。”但不幸的是,詹姆从客户发现100元是假的。多么可怜的人!在这种情况下詹姆损失70元(40(商品价格)+ 30(钱返还给客户))。 现在你的任务是计算詹姆将失去多少在这贸易。在这种情况下,当然,有时詹姆可能还赚。 输入 输入由几个实例。每个实例都包含四个整数N,,P和C,它们在范围内的所有[0,50000],由一个空格隔开。 N是詹姆的成本价格。 M是卖出价。 P是客户给詹姆假钱。 C是詹姆客户。 输入。 输出 对于一个实例,输出一个整数,它詹姆在贸易损失。如果詹姆还是赚,只输出一个负整数,其绝对值告诉其中的钱詹姆收入。朗显示对应的拉丁字符的拼音
#include stdio.h
main()
{
int N,M,P,C;
while(1==1)
{
scanf(
您可能关注的文档
最近下载
- (2025年)村干部考试试题.docx VIP
- 项目核心筒内爬式液压布料机施工方案.pdf VIP
- 物流师(二级):配送管理三.docx VIP
- 限制类医疗技术(2025年版)及相关管理要求.docx VIP
- 2025上海市宝山区高三英语二模试题及答案.docx VIP
- 2025上海市长宁区高三英语二模试题及答案.pdf VIP
- 心悸ppt课件_原创精品文档.pptx VIP
- 【2025届上海高三英语二模】2025届上海市浦东新区高三英语二模试卷与答案.pdf VIP
- 多级逆流双极膜电渗析系统再生酸碱操作规范.docx VIP
- 2025四川泸州古蔺县人民法院招聘劳务派遣制审判辅助人员10人考试备考试题及答案解析.docx VIP
文档评论(0)