#include #include #includea.txt0.3,0.225,0.375,0.25,0.5,0.4,0.25,0.3,0.425,0.6,0.35,0.15,0.225,0.25,0.175,0.475,0.225,0.3,0.225,0.4,0.2,0.125,0.425,0.4,0.2,0.225,0.3,0.35,0.275,0.475,0.6,0.35,0.3,0.4,0.25,0.15,0.525,0.375,0.25,0.35,0.225,0.55,0.4,0.2

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 00:47:44
#include #include #includea.txt0.3,0.225,0.375,0.25,0.5,0.4,0.25,0.3,0.425,0.6,0.35,0.15,0.225,0.25,0.175,0.475,0.225,0.3,0.225,0.4,0.2,0.125,0.425,0.4,0.2,0.225,0.3,0.35,0.275,0.475,0.6,0.35,0.3,0.4,0.25,0.15,0.525,0.375,0.25,0.35,0.225,0.55,0.4,0.2
x)SK)MIU`$TIcs f Rafx )\0k51G#Rᡈ!Ԃ5B2n1[;a)x"}<K2 2 pCBŦPA/M~ھIPPu9u () IIMKUS05 &*GZ2J

#include #include #includea.txt0.3,0.225,0.375,0.25,0.5,0.4,0.25,0.3,0.425,0.6,0.35,0.15,0.225,0.25,0.175,0.475,0.225,0.3,0.225,0.4,0.2,0.125,0.425,0.4,0.2,0.225,0.3,0.35,0.275,0.475,0.6,0.35,0.3,0.4,0.25,0.15,0.525,0.375,0.25,0.35,0.225,0.55,0.4,0.2
#include #include #include
a.txt0.3,0.225,0.375,0.25,0.5,0.4,0.25,0.3,0.425,0.6,0.35,0.15,0.225,0.25,0.175,0.475,0.225,
0.3,0.225,0.4,0.2,0.125,0.425,0.4,0.2,0.225,0.3,0.35,0.275,0.475,0.6,0.35,0.3,0.4,0.25,0.15,
0.525,0.375,0.25,0.35,0.225,0.55,0.4,0.2,0.35,0.375,0.4,0.225,0.35,0.575,0.4,
输出结果d.txt 0.300000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,
0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,
0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.0
#include
#define N 51
double s[N];
int B[N],i,j;
void main()
{
FILE *fp;
fp=fopen("a.txt","r");
for(i=0;i

#include #include #includea.txt0.3,0.225,0.375,0.25,0.5,0.4,0.25,0.3,0.425,0.6,0.35,0.15,0.225,0.25,0.175,0.475,0.225,0.3,0.225,0.4,0.2,0.125,0.425,0.4,0.2,0.225,0.3,0.35,0.275,0.475,0.6,0.35,0.3,0.4,0.25,0.15,0.525,0.375,0.25,0.35,0.225,0.55,0.4,0.2
fscanf(fp,"%lf",&s[i]); --> fscanf(fp,"%lf,",&s[i]) 加个逗号
open之後记得close