Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- float LucroA, LucroB,CP, RF;
- int valorA = 0;
- int valorB = 0;
- int meses = 0;
- cout<<"\nDigite o Lucro da obra A, 400m2: ";
- cin>>LucroA;
- LucroB = LucroA /3;
- CP = LucroA * 0.20;
- RF = LucroB * 0.50;
- valorA = LucroA+CP*1;
- valorB = LucroB+RF*1;
- while(valorB < valorA)
- {
- meses++;
- valorA = LucroA+CP*meses;
- valorB = LucroB+RF*meses;
- }
- cout<<"\nMeses necessarios para o lucro da Obra B ultrapasse o lucro da Obra A: "<<meses;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement