你把除i以外的变量定义成浮点型就好了!float||double都行!
程序代码:
#include <stdio.h> int main(void) { unsigned num = 1, days = 10; for (unsigned day = 0; day < days; day++) num = (num + 1) * 2; printf("%u", num); return 0; }
是这样吗?
[此贴子已经被作者于2019-4-12 15:57编辑过]