Free pascal 文件关联急急急急

来源:百度知道 编辑:UC知道 时间:2024/06/09 13:17:49
在线等
一个小的统计程序
program tongji;
var jiaolv,pingchang,leguan,i,j,n,total,gao,zhong,di:integer;
a:array[1..300,1..12]of char;
cj:array[1..300]of integer;
begin
readln(n);
for i:=1 to n do
begin
for j:=1 to 12 do read(a[i,j]);
readln;
end;
for i:=1 to n do
begin
if a[i,1]='a' then cj[i]:=cj[i]+2;
if a[i,1]='b' then cj[i]:=cj[i]+1;
if a[i,2]='b' then cj[i]:=cj[i]+1;
if a[i,2]='c' then cj[i]:=cj[i]+2;
if a[i,3]='a' then cj[i]:=cj[i]+2;
if a[i,3]='a' then jiaolv:=jiaolv+1;
if a[i,3]='b' then pingchang:=pingchang+1;
if a[i,3]='b' then cj[i]:=cj[i]+1;
if a[i,3]='c' then leguan:=leguan+1;
if a[i,4]='b' then cj[i]:=cj[i]+1;
if a[i,4]='c' then cj[i]:=cj[i]+2;
if a[i,5]='a' then cj[i]:=cj[i]+1;
if a[i,5]='b' then cj[i]:=cj[i]+2;
if a[i,6]=

program tongji(input,output);

var jiaolv,pingchang,leguan,i,j,n,total,gao,zhong,di:integer;
a:array[1..300,1..12]of char;
cj:array[1..300]of integer;
begin

assign(input,'in.txt');
assign(output,'out.txt');
reset(input);
rewrite(output);

readln(n);
for i:=1 to n do
begin
for j:=1 to 12 do read(a[i,j]);
readln;
end;
for i:=1 to n do
begin
if a[i,1]='a' then cj[i]:=cj[i]+2;
if a[i,1]='b' then cj[i]:=cj[i]+1;
if a[i,2]='b' then cj[i]:=cj[i]+1;
if a[i,2]='c' then cj[i]:=cj[i]+2;
if a[i,3]='a' then cj[i]:=cj[i]+2;
if a[i,3]='a' then jiaolv:=jiaolv+1;
if a[i,3]='b' then pingchang:=pingchang+1;
if a[i,3]='b' then cj[i]:=cj[i]+1;
if a[i,3]='c' then leguan:=leguan+1;
if a[i,4]='b' then cj[i]:=cj[i]+1;
if a[i,4]='c' th