Add main.cpp
This commit is contained in:
parent
6079728c47
commit
a69d2c8450
1 changed files with 29 additions and 0 deletions
29
main.cpp
Normal file
29
main.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include <iostream>
|
||||
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;
|
||||
}
|
Loading…
Add table
Reference in a new issue