Advertisement
JewishCat

Rek_Ryad_26v

Dec 19th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <cmath>
  3. #include <math.h>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7.  
  8. void rek_r(double mas[]);
  9. int main() {
  10.  
  11.     double mas[256];
  12.     mas[0]=0.5;
  13.     mas[1]=0.25;
  14.     rek_r(mas);
  15.     return 0;
  16. }
  17. void rek_r(double mas[]){
  18.     int i;
  19.     for(i=2;i<15;i++){
  20.         mas[i]=(tanh(mas[i-1]*mas[i-2]))/i;
  21.         cout << "mas["<< i << "] - " << mas[i] << endl;
  22.     }
  23.     if(mas[i]>mas[i-1])  cout << "Ryad rashod";
  24.         else cout << "Ryad shod";
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement