此题异常简单,代码如下,无注释
#include<stdio.h> #include<math.h> float hs(int a,int b,int c){ float s; s=(4.25*(a+b)+log(a+b+sqrt(a+b)+1/(a+b)))/(4.25*c+log(c+sqrt(c)+1/c)); return s; } int main(){ int a,b,c; float m; FILE *fp=fopen("data.txt","w+"); if(fp==0) printf("erreo"); for(int i=0;i<10;i++){ printf("请输出第%d组abc的值\n",i+1); scanf("%d%d%d",&a,&b,&c); float hs(int a,int b,int c); m=hs(a, b, c); printf("%f\n",m); fprintf(fp,"T%d=%f\n",i+1,m); } fclose(fp); return 0; }