Advertisement
JewishCat

Rek_Ryad_23v

Dec 21st, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 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(double mas[]);
  9. int main() {
  10.    
  11.     double mas[256];
  12.     mas[0]=1;
  13.     mas[1]=0.5;
  14.     rek(mas);
  15.     return 0;
  16. }
  17. void rek(double mas[]){
  18.     cout << "mas[0] - " << mas[0] << endl;
  19.     cout << "mas[1] - " << mas[1] << endl;
  20.     int i;
  21.     for(i=2;i<10;i++){
  22.         mas[i]=mas[i-1]*mas[i-2];
  23.         cout << "mas["<< i << "] - " << mas[i] << endl;
  24.     }
  25.     if(mas[i]>mas[i-1])  cout << "Ряд расходится";
  26.         else cout << "Ряд сходится";
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement