习题2-7

#include <stdio.h> 
#include <math.h> 
int main(void) 
{  
    int i,n;  
    double x;  
    scanf("%d",&n); 
    x=0; 
    for(i=1;i<=n;i++){  
        x=x+powl(2,i); 
    }  
    printf("x=%.0f\n",x);  


    return 0;

posted on 2013-10-19 22:27  大叔控727  阅读(84)  评论(0编辑  收藏  举报

导航