intmain()
{
inta[16]={0};
FILE*fp=fopen("aa.txt","r");
inti=0;
while(!feof(fp))
{
fscanf(fp,"%d",&a[i]);
i++;
}
return0;
}
扩展资料
在Python一次性读取数据
file='novel.txt'
withopen(file)asfile_object:
contents=file_object.read()
print(contents)
运行结果:
Itisatruthuniversallyacknowledged,thatasinglemaninpossessionofagoodfortune,mustbeinwantofawife.