Final Config
This commit is contained in:
parent
2b80bf5bed
commit
fabcfd913f
1 changed files with 23 additions and 4 deletions
27
main.cpp
27
main.cpp
|
@ -1,6 +1,25 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
int main() { int i,n; float suma; int f0=0,f1=1; float zl;
|
|
||||||
cout << "N = "; cin >> n; cout << f0 << " " << f1 << " ";
|
int main() {
|
||||||
for(i=2;i<=n;i++) { suma=f0+f1; cout << suma << " "; f0=f1; f1=suma; }
|
int i, n;
|
||||||
zl=suma/f0; cout << "\nZlota liczba = " << zl << endl; return 0; }
|
float suma;
|
||||||
|
int f0 = 0, f1 = 1;
|
||||||
|
float zl;
|
||||||
|
|
||||||
|
cout << "N = ";
|
||||||
|
cin >> n;
|
||||||
|
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;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue