|
|
发表于 2023-7-3 17:36:40
|
显示全部楼层
0.long long int
1.char
2.不是
3.8
4.char
5.E类型应该加()
Fsizeof
6.int 因为int 默认为signed int可以存负数
7.自己编程错误
0.#include "stdio.h"
#include "math.h"
main()
{ int r;
r=pow(1,2)+pow(2,3)+pow(3,4)+pow(4,5)+pow(5,6);
printf("%d",r);
return 0;
}
1.#include "stdio.h"
#include "math.h"
main()
{
int i,sum=0,temp;float weight;
for(i=0;i<64;i++)
{
temp=pow(2,i);
sum=sum+temp;
}
weight=sum/25000.0;
printf("舍罕王应该给予达依尔%d粒麦子\n",sum);
printf("如果每25000粒麦子为1kg,那么应该给%.2f公斤麦子!\n",weight);
return 0;
} |
|