// 100_15.cpp : Defines the entry point for the console application. // #include "stdafx.h" int fibo1(int n) { if(n==0) return 0; else if(n==1) return 1; int f0=0; int f1=1; int f2; for(int i=2;i<=n;i++) { f2 = f1+f0; f0=f1; f1=f2; } return f2; } int _tmain(int argc, _TCHAR* argv[]) { printf("%d\n",fibo1(8)); return 0; }