mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
20 lines
324 B
C++
20 lines
324 B
C++
|
#include<stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
int n;
|
||
|
_int64 a[35],b[35];
|
||
|
int i;
|
||
|
a[0]=1;
|
||
|
b[0]=0;
|
||
|
for(i=1;i<34;i++)
|
||
|
{
|
||
|
a[i]=3*a[i-1]+2*b[i-1];
|
||
|
b[i]=b[i-1]+a[i-1];
|
||
|
}
|
||
|
while(scanf("%d",&n)!=EOF&&n!=-1)
|
||
|
{
|
||
|
printf("%I64d, %I64d\n",a[n],b[n]);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|