|
|
发表于 2018-7-4 19:37:41
|
显示全部楼层
测试题:
0.long long int
1.比特
2.sizeof()用于获得数据类型和表达式的长度
3.8
4.char
5.B F
6.无符号数可以
7.程序会按照我们给定的代码执行
动动手
0.#include<stdio.h>
#include<math.h>
int main()
{
int sum;
sum=pow(1,2)+pow(2,3)+pow(3,4)+pow(4,5)+pow(5,6);
printf("The result is %d",sum);
return 0;
}
1.
#include<stdio.h>
#include<math.h>
int main()
{
unsigned long int sum=0,temp=0,weight=0;
//float weight;
int i,m=0;
for(i=0;i<=63;i++)
{
temp=pow(2,m);
m+=1;
sum=sum+temp;
}
weight=sum/25000;
printf("total weight is %ld kg of wheat\n",weight);
return 0;
}
|
|