fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int k=15;
  6. double contrib=2,a,contrez=0;
  7. double koef=1.0;
  8. double usd=1.99/57;
  9.  
  10. contrib=contrib*koef;
  11. for(int i=0; i<k; i++)
  12. {
  13. if(i<5)
  14. {
  15. contrez=contrez+contrib;
  16. }
  17. else
  18. {
  19.  
  20. contrib=contrib*0.9;
  21. contrez=contrez+contrib;
  22. }
  23. }
  24. double rez;
  25. //rez=(k*usd)/contrez;
  26. rez=(k*usd+(k*usd*0.008))/contrez;
  27. cout << "контриб: " << contrez << endl;
  28. cout << "copies: " << k << endl;
  29. cout << "koef: " << rez << endl;
  30. cout << "цена: " << k*usd ;
  31. return 0;
  32. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
контриб: 21.7238
copies: 15
koef: 0.0242993
цена: 0.523684