|
|
发表于 2022-7-5 09:36:46
|
显示全部楼层
0 long long int
1 short int?
2 不是
3 1?
4 char
5 E
6 unsigned int
7 True or False
0 (我算的16739)
- #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("%d", a);
-
- return 0;
- }
复制代码
1 (编不出来,也不知道问题出在哪里)
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int i;
- long long int temp;
- long long int sum;
- double weight;
-
- for (i=0; i<64; i++)
- {
- temp = pow(2, i);
- sum = sum + temp;
- }
-
- weight = sum / 25000;
-
- printf("舍罕王应该给予达依尔%d粒麦子!\n", sum);
- printf("如果每25000粒麦子为1kg,那么应该给%.0f公斤!\n", weight);
-
- return 0;
- }
复制代码 |
|