1 / 5
ファイルへの入出力
50 likes | 161 Vues
ファイルへの入出力. C の導入. #include <stdio.h> int main() printf(“Hello!<br>”); return 0; }. #include <math.h> #include <stdio.h> int main() { FILE *fp = fopen("data.csv","w"); int i; float x[101],y[101],pi; pi = 3.141592; for (i = 0; i <=100; i++) { x[i]=2.0*i/100.0*pi;
Télécharger la présentation
ファイルへの入出力
An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.
Content is provided to you AS IS for your information and personal use only.
Download presentation by click this link.
While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
During download, if you can't get a presentation, the file might be deleted by the publisher.
E N D
Presentation Transcript
Cの導入 #include <stdio.h> int main() printf(“Hello!\n”); return 0; }
#include <math.h> #include <stdio.h> int main() { FILE *fp = fopen("data.csv","w"); int i; float x[101],y[101],pi; pi = 3.141592; for (i = 0; i <=100; i++) { x[i]=2.0*i/100.0*pi; y[i]=sin(x[i]); fprintf(fp,"%d,%f,%f\n",i,x[i],y[i]); } fclose(fp); return 0; } ファイル書込みの例
More Related