1 solutions
-
0
C++ :
#include <iostream> #include <stdio.h> #include <algorithm> using namespace std; int a,b,c,N,x,y; int main() { // freopen("9L.in","r",stdin); // freopen("9L.out","w",stdout); cin >>N; a=b=1; for (int i=1; i<N; i++) { c=a+b; a=b; b=c; } cout << a<<endl; return 0; }
- 1
Information
- ID
- 836
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 10
- Tags
- (None)
- # Submissions
- 4
- Accepted
- 4
- Uploaded By