Advertisement
JewishCat

Rek_Ryad_23v

Dec 20th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 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[], int n);
  9. int main() {
  10.    
  11.     int n;
  12.     double mas[256];
  13.     mas[0]=1;
  14.     mas[1]=0.5;
  15.     cout << "Enter value a N:" << endl;
  16.     cin >> n;
  17.     rek(mas,n);
  18.     return 0;
  19. }
  20. void rek(double mas[], int n){
  21.     cout << "mas[0] - " << mas[0] << endl;
  22.     cout << "mas[1] - " << mas[1] << endl;
  23.     for(int i=2;i<=n;i++){
  24.         mas[i]=mas[i-1]*mas[i-2];
  25.         cout << "mas["<< i << "] - " << mas[i] << endl;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement