#include <stdio.h>
#include <math.h>
main()
{
int i;
double points[99][2];
FILE *fid,*write;
fid=fopen("coords.txt","r");
for(i=0;i<100;i++)
points[i]={x,y,z};
fscanf(fid,"%1f%1f%1f",points[i]);
if(sqrt(x*x+y*y+z*z)==i)
write=fopen("out.txt","w");
fprintf(fid,"%d%d\n",i,points[i]);
fclose(write);
else
break;
fclose(fid);
}
#include <math.h>
main()
{
int i;
double points[99][2];
FILE *fid,*write;
fid=fopen("coords.txt","r");
for(i=0;i<100;i++)
points[i]={x,y,z};
fscanf(fid,"%1f%1f%1f",points[i]);
if(sqrt(x*x+y*y+z*z)==i)
write=fopen("out.txt","w");
fprintf(fid,"%d%d\n",i,points[i]);
fclose(write);
else
break;
fclose(fid);
}
Comments
Post a Comment