Вы находитесь на странице: 1из 1

/* programa creado en la

primera clase de C++


proyeccion social lifee*/
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
float MT,M1,M2,M3;
int e1,e2,e3;
cout<<"ingrese monto total: ";
cin>>MT;
cout<<"ingrese las edades: ";
cin>>e1>>e2>>e3;
M1 = MT*e1/(e1+e2+e3);
M2 = MT*e2/(e1+e2+e3);
M3 = MT*e3/(e1+e2+e3);
cout<<"el monto a repartir a cada uno sera: ";
cout<<"\nmonto 1: "<<M1;
cout<<"\nmonto 2: "<<M1;
cout<<"\nmonto 3: "<<M3;
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}

Вам также может понравиться