问题描述:
分析:
编程实现:
#include <stdio.h>
int main()
{
int money = 0;
scanf("%d", &money);
int empty = money;
int total = money;
while (empty > 1) {
total = total + empty / 2;
empty = empty / 2 + empty % 2;
}
printf("%d", total);
}
问题描述:
分析:
编程实现:
#include <stdio.h>
int main()
{
int money = 0;
scanf("%d", &money);
int empty = money;
int total = money;
while (empty > 1) {
total = total + empty / 2;
empty = empty / 2 + empty % 2;
}
printf("%d", total);
}