指数增长

#include

#define SQUARES 64 

#define CROP 1E15

void main()

{

    double current , total ;

    int count = 1;

    printf( " square grains total ");

    printf("fraction of \n ");

    printf("  added grain    ");

    printf(" US total \n ");

    total = current =1.0;

    printf("%4d %13.2e %12.2e \n",count ,current,total/CROP);

    while (count < SQUARES) {

        count = count +1;

        current =2.0 * current ;

        total , total /CROP;

        printf("%4d %13.2e %12.2e \n",count ,current,total/CROP);

    }

    printf("that all\n");


}

指数增长_第1张图片

你可能感兴趣的:(指数增长)