1. What I learned
printf(), scanf()
printf() and scanf() is faster and use less memory than cout and cin.
2. Code
#include <stdio.h>
int fib(int num) {
if (num<2) return num;
return (fib(num-1)+fib(num-2));
}
int main(void) {
int n;
scanf("%d", &n);
printf("%d\n", fib(n));
return 0;
}
3. Result
Runtime : 0 ms, Memory usage : 1116 KB
(Runtime can be different by a system even if it is a same code.)