* * * 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.