|
|
发表于 2020-9-26 22:40:45
|
显示全部楼层
[unsigned] long long [int]
char和_Bool
是
一个?
肯定是_Bool!
A、B、C、D
unsigned
程序知道啥说啥,没有中间值
如下:
零、
#include <stdio.h>
int main()
{
unsigned int a;
a=pow(1,2)+pow(2,3)+pow(3,4)+pow(4,5)+pow(5,6);
printf("\n%d\n",a);
return 0;
}
答:16739
一、
#include <stdio.h>
#include <math.h>
int main()
{
unsigned long sum;
unsigned long temp;
unsigned long weight;
int i;
for (i=0;i<64;i++)
{
temp = pow(2,i);
sum = sum + temp;
}
weight = sum / 25000;
printf("舍罕王应该给予达依尔%u粒麦子!\n",sum);
printf("如果每25000粒麦子为1kg,那么应该给%u公斤麦子!\n",weight);
return 0;
}
(不知道为什么用不了longlong只能用long=。=答案是错的) |
|