Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <cmath>
- #include <math.h>
- #include <iostream>
- using namespace std;
- void rek(double mas[], int n);
- int main() {
- int n;
- double mas[256];
- mas[0]=1;
- mas[1]=0.5;
- cout << "Enter value a N:" << endl;
- cin >> n;
- rek(mas,n);
- return 0;
- }
- void rek(double mas[], int n){
- cout << "mas[0] - " << mas[0] << endl;
- cout << "mas[1] - " << mas[1] << endl;
- for(int i=2;i<=n;i++){
- mas[i]=mas[i-1]*mas[i-2];
- cout << "mas["<< i << "] - " << mas[i] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement