Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "math.h"
  3. #include <iostream>
  4.  
  5. using namespace std;
  6. int _tmain(int argc, _TCHAR* argv[])
  7. {
  8.     int i=0;
  9.     double dlina=1500, rashod=2, obyom=600, predel, pereezdi=0, z, n, bac=0;
  10.         predel=dlina/(obyom/rashod);
  11.         cout<<"predel="<<predel<<"\n";
  12.  
  13.         while(pereezdi<predel)
  14.         {
  15.             z=(2*i)+1;
  16.             n=1/z;
  17.             pereezdi=pereezdi + n;    //(1/((2*i)+1));
  18.             bac = bac + 1;
  19.             //cout<<"pereezdi="<<pereezdi<<"\n"<<"i="<<i<<"\n"<<"znamenatel="<<z<<"\n"<<"to chto + ="<<n<<"\n"<<"bacov ="<<bac<<"\n"<<"\n" ;
  20.             i++;
  21.         }
  22.         cout<<"pereezdi="<<pereezdi<<"\n"<<"i="<<i<<"\n"<<"znamenatel="<<z<<"\n"<<"to chto FEDUARD PIDOR  + ="<<n<<"\n"<<"bacov ="<<bac<<"\n"<<"\n" ;
  23.             return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement