#include <stdio.h>
int main(void) {
int i=1,n,sum=0,pre=2;//pre…前項
while(i<=n){
sum=sum+pre;
pre=pre*3;
i=i+1;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgaT0xLG4sc3VtPTAscHJlPTI7Ly9wcmXigKbliY3poIUKCQoJc2NhbmYoIiVkIiwmbik7Cgl3aGlsZShpPD1uKXsKCQlzdW09c3VtK3ByZTsKCQlwcmU9cHJlKjM7CgkJaT1pKzE7Cgl9CglwcmludGYoIiVkIixzdW0pOwoJcmV0dXJuIDA7Cn0K