Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: manolo.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main()
- {
- int total, paga, vueltos, temp;
- cout << "Almacen Don Manolo" << endl;
- cout << "==================" << endl;
- cout << "Total a pagar = "; cin >> total;
- cout << "El cliente paga = "; cin >> paga;
- vueltos = paga - total;
- cout << endl;
- cout << "Vuelto = " << vueltos << endl;
- cout << "Desglosado en:" << endl;
- temp=vueltos / 10000;
- cout << temp << " billete(s) de 10000\n";
- vueltos -= temp * 10000;
- temp = vueltos / 5000;
- cout << temp << " billete(s) de 5000\n";
- vueltos -= temp * 5000;
- temp = vueltos / 1000;
- cout << temp << " billete(s) de 1000\n";
- vueltos -= temp * 1000;
- temp = vueltos / 500;
- cout << temp << " billete(s) de 500\n";
- vueltos -= temp * 500;
- temp = vueltos / 100;
- cout << temp << " moneda(s) de 100\n";
- vueltos -= temp * 100;
- temp = vueltos / 50;
- cout << temp << " moneda(s) de 50\n";
- vueltos -= temp * 50;
- temp = vueltos / 10;
- cout << temp << " moneda(s) de 10\n";
- vueltos -= temp * 10;
- temp = vueltos / 5;
- cout << temp << " moneda(s) de 5\n";
- vueltos -= temp * 5;
- cout << vueltos << " moneda(s) de 1\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement