马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#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粒麦子为1KG,那么应该给%11u公斤麦子!\n", weight);
return 0;
}
————————————————————————————————————————————————————————————
#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("如果每2500粒麦子为1Kg,那么应该给%11u公斤麦子!\n", weight);
return 0;
}
|