时间:2021-02-11 11:19:40 | 栏目:C代码 | 点击:次
C-sources:
#include<stdio.h> int main() { FILE* fp; //定义一个文件 fp = fopen("p5.txt","r"); if(fp == NULL) { printf("ERROR!\N"); return; } int TwoPointSignal[1000]; int n,k=0,j; while(!feof(fp)) { fscanf(fp,"%d",&n); TwoPointSignal[k]=n; k++; } fclose(fp); for(j=0;j<15;j++) { printf("%d\t",TwoPointSignal[j]); if(j%8==0) printf("\n"); } return 0; }
p5.txt:
结果图: