|
|
back to boardWA on test 4 what is test 4. plz help me. my code is below #include<bits/stdc++.h> using namespace std; int main() { long n=1000,i,k; long long a[100000]; a[0]=0,a[1]=1; for(i=2;i<n;i=i+2){ k=i/2; a[i]=a[k],a[i+1]=a[k]+a[k+1]; } cin>>n; while(n){ cout<<*max_element(a,a+n+1)<<endl; cin>>n; } } Edited by author 22.06.2019 13:46 |
|
|