求大神讲代码
#include <stdio.h>int djf(int x)
{
if(x==1) return 1;
else if(x==2) return 3;
else return djf(x-1)+2*djf(x-2);
}
int main()
{
int c;
scanf("%d",&c);
while(c--)
{
int n;
scanf("%d",&n);
printf("%d\n",djf(n));
}
return 0;
}
2016-09-25 11:00
2016-09-30 17:08