#include <math.h>int array(long int n){long int a2[100]=;long int a3[100]=;int i;long int t1,t=2;for(i=2;i<100;i++){a2[i]=a2[i-2]+a2[i-1];a3[i]=a3[i-2]+a3[i-1];}for(i=0;i<100;i++){t1=t;t=pow(2,a2[i])*pow(3,a3[i]);if(n<t)}if((n-t1)<(t-n))else}main(){long int n;printf("input a long int:");scanf("%ld",&n);printf("\nnearest item in array is:%d\n",array(n));}以上为函数方法,数列方法的话就把函数中的内容全写到main中吧