From a69d2c8450932cdead5df15b1be126f3239ea4f8 Mon Sep 17 00:00:00 2001 From: nyosic Date: Wed, 2 Apr 2025 00:18:47 +0000 Subject: [PATCH] Add main.cpp --- main.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 main.cpp diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..65d0e7e --- /dev/null +++ b/main.cpp @@ -0,0 +1,29 @@ +#include +using namespace std; + +int main() { + int i,n; + float suma; + int f[100], f0, f1; + float zl; + + + cout << "N = "; + cin >> n; + f0 = 0; + f1 = 1; + cout << f0 << " " << f1 << " "; + for(i = 2;i<=n;i++) { + suma = f0 + f1; + cout << suma << " "; + f0 = f1; + f1 = suma; + } + + zl = suma/f0; + + cout << "\nZlota liczba = " << zl << endl; + + system("pause"); + return 0; +} \ No newline at end of file