|
|
发表于 2020-1-26 22:14:36
|
显示全部楼层
测试题
1.用long long int
2.short int
3.不是
4.不知道
5.short int
6.B错 D错 F不知道
7.不知道
8.程序只有绝对的真或假,对或错,没有别的判断
动动手
1.#include <stdio.h>
int main()
{
int a,b,c,d,e;
a=pow(1,2);
b=pow(2,3);
c=pow(3,4);
d=pow(4,5);
e=pow(5,6);
printf("result=%d\n",a+b+c+d+e);
}
2.#include <stdio.h>
#include <math.h>
int main()
{
int sum,temp,i,weight;
for(i=0;i<64;i++)
{
temp=pow(2,i);
sum=sum+temp;
}
weight=sum/25000;
printf("舍罕王给予达依尔%d粒麦子!\n",sum);
printf("如果每25000粒麦子为1kg,那么应该给%d公斤麦子!\n",weight);
return 0;
} |
|