文件读写
pascal吧
全部回复
仅看楼主
level 0
gchees 楼主
求救:在PASCAL程序中要用到文件输入输出,具体如何用?请给具体例子,如十一届的“陶陶摘苹果”……
2006年04月26日 09点04分 1
level 2
program apple; var a:array[1..10] of integer; n,i,total:integer;beginassign(input,'apple.in');reset(input);assign(output,'apple.out');rewrite(output); for i:=1 to 10 do read(a[i]); readln(n); n:=n
+3
0; for I:=1 to 10 do if n>=a[i] then inc(total); writeln(total); close(output);close(input);End.
2006年04月26日 10点04分 2
level 0
gchees 楼主
谢谢!!!
2006年04月26日 12点04分 3
level 0
gchees 楼主
有没有另外三题的程序?一起给
2006年04月26日 12点04分 4
level 5
begin后加上assign(input,‘文件名。格式 ‘);reset(input);
assign(output,‘文件名。格式 ‘);rewrite(output);
end前加上close(input);close(output);
2015年11月02日 13点11分 5
1