|
|
发表于 2018-2-21 22:41:49
|
显示全部楼层
0 long long int 类型 或者 double 类型 或者 long double 类型
1 char 和 _Bool类型 1个字节
2 是的
3 一个字节等于8个比特位
4 布尔类型
5 E和F
6 unsigned int 可以表示更大的数
7 程序是根据人们设计的指令执行的
动动手
0
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
int main()
{
int s;
s = pow(1.0,2)+pow(2.0,3)+pow(3.0,4)+pow(4.0,5)+pow(5.0,6);
printf("1^2 + 2^3 + 3^4 + 4^5 + 5^6 = %d\n",s);
return 0;
}
1
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
int main()
{
int i;
long double sum, temp, weight;
sum = 0;
for(i=0; i<64; i++)
{
temp = pow(2.0, i);
sum = sum + temp;
}
weight = sum / 25000;
printf("舍罕王应该给予达依尔%.0f粒麦子!\n", sum);
printf("如果每25000粒麦子为1kg,那么应该给%.0f公斤麦子!\n",weight);
return 0;
}
|
|