#include "stdio.h"
void main()
{
double a,number;
double b=0.5;
number=3;
while (number>0)
{
a=(b+0.5)*2;
b=a;
number--;
}
printf("%d",a);
}
问的问题太多了 分没了
#include "stdio.h"
void main()
{
double a,number;
double b=0.5;
number=3;
while (number>0)
{
a=(b+0.5)*2;
b=a;
number--;
}
printf("%d",a);
}
问的问题太多了 分没了
#include "stdio.h"
void main()
{
double a;
double b=0.5;
int number=3;
while (number>0)
{
a=(b+0.5)*2;
b=a;
number--;
}
printf("%lf \n",a);
}
//可以了
number设为整型