1 #include<stdio.h> 2 int main() 3 { 4 int n,s,i; 5 while(~scanf("%d",&n)) 6 { 7 for(i=s=1; i<n; ++i) 8 s=(s+1)*2; 9 printf("%d\n",s); 10 } 11 return 0; 12 }
时间: 2024-10-17 03:05:47
1 #include<stdio.h> 2 int main() 3 { 4 int n,s,i; 5 while(~scanf("%d",&n)) 6 { 7 for(i=s=1; i<n; ++i) 8 s=(s+1)*2; 9 printf("%d\n",s); 10 } 11 return 0; 12 }