|
|
发表于 2020-7-8 16:56:28
|
显示全部楼层
0.long long int
1.1个字节
2.sizeof()是一个运算符
3.8个比特位
4.字符类型
5.f
6.unsigned int
7.在输入相同的情况下,同一个程序在同一个机器中的执行结果总是相同的
0.- #include<stdio.h>
- #include<math.h>
- int main()
- {
- //计算1^2 + 2^3 + 3^4 + 4^5 + 5^6
- printf("1^2 + 2^3 + 3^4 + 4^5 + 5^6=%.2f\n",pow(1,2) + pow(2,3) +pow(3,4) + pow(4,5) + pow(5,6));
- return 0;
- }
复制代码
1.- #include<stdio.h>
- #include<math.h>
- int main()
- {
- float count=0,weight,temp,i;
- for(i=0;i<64;i++)
- {
- temp = pow(2,i);
- count = count + temp;
- }
- weight = count/25000;
- printf("舍罕王应该给予达依尔%.0f粒麦子!\n",count);
- printf("如果每25000粒麦子为1kg,那么应该给%.0f公斤麦子!\n",weight);
- return 0;
-
- }
复制代码 |
|