#include <stdio.h> int main(int argc, char *argv[]) { int a = 1,b = 0,day = 0;//a为当天买的数量,b为一共买的数量 ,day为天数 while(1) { day++; a = a*2; if(a+b>100) break; b = a+b; } //printf("%d",day); float money; money = (float)80/day;//80为总100个的总价,money为平均每天的价格 printf("%f\n",money); return 0; }