Advertisement
MatheusMagnani

Untitled

Oct 4th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. int main()
  2. {
  3.     float LucroA, LucroB,CP, RF;
  4.     int valorA = 0;
  5.     int valorB = 0;
  6.     int meses = 0;
  7.  
  8.     cout<<"\nDigite o Lucro da obra A, 400m2: ";
  9.     cin>>LucroA;
  10.  
  11.     LucroB = LucroA /3;
  12.     CP = LucroA * 0.20;
  13.     RF = LucroB * 0.50;
  14.  
  15.     valorA = LucroA+CP*1;
  16.     valorB = LucroB+RF*1;
  17.  
  18.     while(valorB < valorA)
  19.     {
  20.         meses++;
  21.         valorA = LucroA+CP*meses;
  22.         valorB = LucroB+RF*meses;
  23.     }
  24.     cout<<"\nMeses necessarios para o lucro da Obra B ultrapasse o lucro da Obra A: "<<meses;
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement