不知道哪错了
#include <stdio.h>#include <math.h>
int main()
{
unsigned long long sum = 0;
unsigned long long temp;
unsigned long long weight;
int i;
for (i=0; i < 64; i++)
{
temp = pow(2,i);
sum = sum + temp;
}
weight = sum / 25000;
printf("舍罕王应该给予达依尔%11u粒麦子\n",sum);
printf("如果每25000粒麦子为1千克,那么应该给达依尔%11u公斤的麦子\n",weight);
return 0;
} 这哪错了答案不一样 %llu
不是%11u
字母不是数字 unsigned long long 类型对应的是 %llu,不是 %11u。
printf("舍罕王应该给予达依尔%llu粒麦子\n",sum);
页:
[1]