|
|
发表于 2022-3-16 15:02:22
|
显示全部楼层
#include<stdio.h>
#include<math.h>
int main()
{
float i = 1;
float j = 2;
double sum;
sum = pow(i,j) + pow((i+1),(j+1)) + pow((i+2),(j+2)) + pow((i+3),(j+3))+ pow((i+4),(j+4));
printf("sum = %lf\n",sum);
return 0;
}
#include<stdio.h>
#include<math.h>
int main()
{
unsigned long long int sum = 0;
unsigned long long int temp,weight;
int i;
for(i = 0;i < 64;i++)
{
temp = pow(2,i);
sum += temp;
}
weight = sum / 25000;
printf("舍罕国王应该介于达依尔%llu粒麦子!\n如果每25000粒麦子为1kg,那么应该给%llukg麦子\n",sum, weight);
return 0;
}
|
|