Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: millonario.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- double valor, carlos, jose, martha;
- cout << "Testamento" << endl;
- cout << "==========" << endl;
- cout << "Entre el valor a repartir = "; cin >> valor;
- carlos = 1.0/3.0 * valor;
- jose = 4.0/3.0 * carlos;
- martha = 1.0/2.0 * jose;
- cout.setf(ios::fixed);
- cout << setprecision(2);
- cout << "A Carlos le corresponde " << valor/3 << endl;
- cout << "A Jose le corresponde " << jose << endl;
- cout << "A Martha le corresponde " << martha << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement