|
|
发表于 2021-2-4 23:28:10
|
显示全部楼层
0.
long long int
1.
short int
2.
不是
3.
4个
4.
int
5.
BDF
6.
unsigned int
7.
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {
int result;
result=pow(1, 2)+pow(2, 3)+pow(3, 4)+pow(4, 5)+pow(5, 6);
printf("result is %d\n",result);
//求 1^2 + 2^3 + 3^4 + 4^5 + 5^6 的值
}
1.
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {
int count=0;
int i=64;
long long int total=0;
//char wheat;
long long int wheat;
long long int weight;
while (count<i) {
wheat=pow(2, count);
printf("%d\n",wheat);
total=total+wheat;
count++;
}
weight=(total/25000)*2;
printf("舍罕王应该给达伊尔%d粒麦子!\n",total);
printf("重达%dkg\n",weight);
return 0;
} |
|