几位说得对,那个小程序,我用了double就对了,但是我的原程序改了还是那样啊
我把原程序简化了帖上来,再麻烦大家看看
main()
{double st[107],rt[107],kt[107],fz[107];
double at[107]=
{0,0,0,10,80,5,15,10,3,3,5,15,15,5,0,5,5,0,5,0,5,0,5,20,0,0,10,5,10,10,10,5,10,10,5,7,25,0,1
5,0,25,0,10,0,25,0,10,0,5,0,5,0,0,7,5,0,0,20,0,0,15,0,0,25,0,0,10,0,0,20,0,0,10,0,0,5,0,0,5,
5,15,10,15,5,10,5,5,5,0,20,20,2,15,5,5,3,15,3,5,10,
10,5,25,30,15,60};
double mt[107]=
{0,0,0,12,90,8,17,14,4,4,6,17,19,8,0,6,8,0,8,0,8,0,6,23,0,0,13,6,13,12,14,8,11,12,6,9,29,0,1
7,0,28,0,13,0,27,0,14,0,8,0,6,0,0,8,6,0,0,23,0,0,16,0,0,27,0,0,11,0,0,23,0,0,13,0,0,6,0,0,6,
6,20,14,18,8,14,7,6,6,0,25,28,3,18,8,6,4,18,4,9,13,
14,6,28,32,19,70};
double bt[107]=
{0,0,0,15,100,10,20,15,5,5,10,20,20,10,0,10,10,0,10,0,10,0,7,30,0,0,15,7,15,15,15,10,15,15,7
,10,30,0,20,0,30,0,15,0,30,0,15,0,10,0,7,0,0,10,7,0,0,25,0,0,20,0,0,30,0,0,15,0,0,25,0,0,15,
0,0,10,0,0,7,7,25,15,20,10,15,10,10,7,0,30,30,5,20,
10,7,5,20,5,10,15,15,7,30,40,20,80};
int i,j;
for(i=0;i<4;i++)
{if(at[i]!=bt[i])
{kt[i]=(4*mt[i]+bt[i]-5*at[i])/(5*bt[i]-at[i]-4*mt[i]);
st[i]=(34*kt[i]-kt[i]*kt[i]-1)/((kt[i]+1)*(kt[i]+1)*(kt[i]+1));
rt[i]=kt[i]*st[i];
fz[i]=pow((bt[i]-(at[i]+(bt[i]-at[i])*rt[i])),(st[i]-1));}
else fz[i]=123456;}
for(j=0;j<4;j++)
printf("%f\n",fz[j]);}