|
|
发表于 2020-10-14 09:41:27
|
显示全部楼层
0. double
1. short int
2. 是的
3.8个比特位
4._bool
5.E,F,B
6 unsigned int
7 因为程序只有YES和NO
0-0
#include <stdio.h>
#include <math.h>
int main()
{
int a;
a = pow(1,2)+pow(2,3)+pow(3,4)+pow(4,5)+pow(5,6);
printf("1^2+2^3+3^4+4^5+5^6=%d\n",a);
return 0;
}
0.1
#include <stdio.h>
#include <math.h>
int main()
{
double sum;
double weight;
int i;
double temp;
for (i=0; i<64;i++)
{
temp = pow(2, i);
printf("%0.f\n", temp);
sum = sum + temp ;
}
weight = sum / 25000;
printf("舍罕王应该给予%0.f粒麦子\n", sum);
printf("应该给予%0.f公斤麦子\n", weight);
return 0;
} |
|