acm-buy sugar,,,

Source: Internet
Author: User
* * * The copyright and version of the Declaration section: *copyright (c) 2013, Yantai University computer college students *allrightsreserved. * File Name: * Author: Tanaka Lin * Date of Completion: October 22, 2013 * Version number: v1.0 * Description of the task and solution method: * Input Description: Small yoga is a love to eat candy Changui, every day shouting to Dad to buy candy, but Dad is busy, which have time ah, so let little yoga himself, Candy 3 cents a piece, dad to small yoga n yuan money, please tell Little Yu can buy a few pieces of sugar, there are a few cents left. * Problem Description: Input dad to small yoga money n yuan, n is an integer. * Program output: Small yoga can buy up the number of sweets and the rest of the money (unit: angle), separated by a space. * Problem Analysis: * Algorithm Design: * * My program: #include <iostream> usingnamespacestd; Intmain () {intmoney,geshu,remain; doubleprice=0.3 cout<< "Please enter the amount of money (yuan):"; cin>>money; Geshu=money/price; Remain= (Money-geshu*price) *10; cout<< "can buy the number of sugar:" <<geshu<< "<<" The remaining amount of money for (corner): "<<remain<<endl; Return0; }


Run Result:

Experience: slightly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.