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-12-22 07:31:24
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 }