#include#define MAX 20int main(){ int money=MAX; int count=MAX; while(1) { if(money%2!=0) { count=count+money-1; break; } else { money=money/2; count+=money; } } printf("%d\n",count); return 0;}
本文共 275 字,大约阅读时间需要 1 分钟。
#include#define MAX 20int main(){ int money=MAX; int count=MAX; while(1) { if(money%2!=0) { count=count+money-1; break; } else { money=money/2; count+=money; } } printf("%d\n",count); return 0;}
转载于:https://blog.51cto.com/10740329/1709390