|
|
发表于 2024-3-18 23:09:59
|
显示全部楼层
测试题:
0.long long int
1.字符类型char和布尔类型_Bool
2.否,运算符
3.8
4.整形类型int
5.E F
6.unsigned int
7.要么是,要么否
动动手:
0.
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int result;
- result = 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", result);
- return 0;
- }
复制代码
1.
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- unsigned long long int sum=0, temp=0, wholeweight=0, i;
- for (i = 1; i < 64; i++)
- {
- temp = pow(2,i);
- sum += temp;
- }
- wholeweight = sum / 25000;
- printf("舍罕王要兑现他的许诺共要 %llu 粒麦子赏赐他的宰相\n", sum);
- printf("如果每25000粒麦子重1kg,那么舍罕王应该给予达依尔 %llu kg麦子\n", wholeweight);
- return 0;
- }
复制代码 |
|