Главная » 2018 » Октябрь » 15 » Циклы 10
10:11
Циклы 10

#include <iostream>
using namespace std;
int main()
{
    setlocale (0, "rus");
    const int n=40;
    double f1=0,f2=1,f;
    cout<<f1<<endl;
    cout<<f2<<endl;
    for (int i=1;i<=n;i++)
    {
        f=f1+f2;
        cout<<f<<" "<<f/f2<<endl;
        f1=f2;
        f2=f;
    }
    system ("pause");
}

Просмотров: 234 | Добавил: denjes | Рейтинг: 0.0/0
Всего комментариев: 0
avatar