Created
March 28, 2019 05:26
-
-
Save ruyut/a6527eafd16a0f4b26ca1082be7ec1df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//905-2 | |
#include<stdlib.h> | |
#include<stdio.h> | |
int main() { | |
FILE *fi;//宣告檔案指標 | |
double ss;//宣告雙精浮點數 | |
fi = fopen("dnumber.dat", "r");//使用讀取的方式開啟檔名為dnumber.dat的檔案 | |
while (fscanf(fi, " %lf ", &ss) != EOF) {//如果讀不到資料就跳出 | |
printf("%.2lf\n", ss);//列印雙精浮點數 | |
} | |
fclose(fi);//關閉檔案 | |
system("PAUSE");//等待使用者按下任意按鍵 | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment