fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int main()
  5. {
  6. float Value;
  7. FILE * pfile;
  8. pfile=fopen("Xcord.txt","r");
  9. int count=0;
  10. //float x_cord[99];
  11. //float y_cord[99];
  12. float *x_cord=new float[99];
  13. float *y_cord=new float[99];
  14. while(!feof(pfile))
  15. {
  16. fscanf_s(pfile,"%f",&Value);
  17. x_cord[count]=Value;
  18. count++;
  19. }
  20. fclose(pfile);
  21. pfile=fopen("Ycord.txt","r");
  22. count=0;
  23. while(!feof(pfile))
  24. {
  25. fscanf_s(pfile,"%f",&Value);
  26. y_cord[count]=Value;
  27. count++;
  28. }
  29. fclose(pfile);
  30. for (int i=0;i<99;i++)
  31. {
  32. for (int j=i+1;j<99;j++)
  33. {
  34. float a =(x_cord[i]-x_cord[j])*(x_cord[i]-x_cord[j])+(y_cord[i]-y_cord[j])*(y_cord[i]-y_cord[j]);
  35. if(a<90000)
  36. {
  37. printf("%d and %d\n",i+1,j+1);
  38. }
  39. }
  40. }
  41. }
  42.  
  43.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16: error: ‘fscanf_s’ was not declared in this scope
prog.cpp:25: error: ‘fscanf_s’ was not declared in this scope
stdout
Standard output is empty