Advertisement
Kocyk

numerki calka

Oct 11th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <stdlib.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double tab1[17];
  9.     double tab2[17];
  10.     tab1[0]=0.182321556;
  11.     tab2[16]=0.0098;
  12.     for(int i=1;i<17;i++)
  13.     {
  14.         tab1[i]=(1/i) - 5*tab1[i-1];
  15.         cout<<tab1[i]<<endl;
  16.     }
  17.     for(int i=15;i>=0;i--)
  18.     {
  19.         tab2[i]= (1/(5.0*(i+1)) - ((1/5.0)* tab2[i+1]));
  20.         cout<<tab2[i]<<endl;
  21.     }
  22.     for(int i=0;i<17;i++)
  23.     {
  24.         cout<<"tab1["<<i<<"] ="<<tab1[i]<<"   tab2["<<i<<"] ="<<tab2[i]<<endl;
  25.     }
  26.     return 0;
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement