mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
ddd34a4f1c
2000-2099
13 lines
227 B
C++
13 lines
227 B
C++
#include<stdio.h>
|
|
int main(){
|
|
int i,n;
|
|
__int64 a[100];
|
|
while(scanf("%d",&n)==1){
|
|
a[1]=2;
|
|
for(i=2;i<=n;i++){
|
|
a[i]=3*a[i-1]+2;
|
|
}
|
|
printf("%I64d\n",a[n]);
|
|
}
|
|
}
|