|
|
发表于 2025-1-17 17:07:14
|
显示全部楼层
测试题:
0.long long int
1._Bool
2.不是,是一个运算符
3.8bit
4._Bool
5.EF
6.unsigned int
7.规则的确定性
动动手:
0.
#include <stdio.h>
#include <math.h>
int main(void){
printf("值是:%f",pow(1,2)+pow(2,3)+pow(3,4)+pow(4,5)+pow(5,6));
ret
1.
#include <stdio.h>
#include <math.h>
int main(void){
int sum = 0;
int temp = 0;
float weight;
int i = 0;
for(int i=0;i<64;i++)
{
temp = pow(2,i);
sum = sum + temp;
}
weight = sum / 25000;
printf("舍罕王应该给予达依尔%.2f粒麦子!",sum);
printf("如果没25000粒麦子为1kg,那么应该给%.2f公斤麦子!",weight);
return 0;
}
|
|