+ 1

Help on c++

guys I made a program now I would like to simplify with the functions someone would know how to help me? #include <iostream> using namespace std; int main() { int k1=0,k2=1,k3,numeri; cout<<"inserisci quanti numeri di fibonacci vuoi "; cin>>numeri; cout<<k1<<" "<<k2<<" "; for(int i=2;i<numeri;++i) { k3=k1+k2; cout<<k3<<" "; k1=k2; k2=k3; } return 0; }

23rd Feb 2020, 2:00 PM
panik 007
panik 007 - avatar
3 Antworten
0
Yes
23rd Feb 2020, 2:35 PM
panik 007
panik 007 - avatar
0
Thanks
23rd Feb 2020, 4:18 PM
panik 007
panik 007 - avatar