主题:请教:普及组第一题,下面的程序可以得多少分?
请教:普及组第一题,下面的程序可以得分吗?得多少分?(没有用循环,但可以正确处理数据。)
program apple;
var fi,fo:text;
m,i:integer;
s:integer;
a:array[1..10] of integer;
begin
assign(fi,'apple.in');
reset(fi);
assign(fo,'apple.out');
rewrite(fo);
read(fi,a[1]);
read(fi,a[2]);
read(fi,a[3]);
read(fi,a[4]);
read(fi,a[5]);
read(fi,a[6]);
read(fi,a[7]);
read(fi,a[8]);
read(fi,a[9]);
read(fi,a[10]);
read(fi,m);
s:=0;
if(a[1]<=m+30)then s:=s+1;
if(a[2]<=m+30)then s:=s+1;
if(a[3]<=m+30)then s:=s+1;
if(a[4]<=m+30)then s:=s+1;
if(a[5]<=m+30)then s:=s+1;
if(a[6]<=m+30)then s:=s+1;
if(a[7]<=m+30)then s:=s+1;
if(a[8]<=m+30)then s:=s+1;
if(a[9]<=m+30)then s:=s+1;
if(a[10]<=m+30)then s:=s+1;
writeln(fo,s);
close(fi);
close(fo);
end.
program apple;
var fi,fo:text;
m,i:integer;
s:integer;
a:array[1..10] of integer;
begin
assign(fi,'apple.in');
reset(fi);
assign(fo,'apple.out');
rewrite(fo);
read(fi,a[1]);
read(fi,a[2]);
read(fi,a[3]);
read(fi,a[4]);
read(fi,a[5]);
read(fi,a[6]);
read(fi,a[7]);
read(fi,a[8]);
read(fi,a[9]);
read(fi,a[10]);
read(fi,m);
s:=0;
if(a[1]<=m+30)then s:=s+1;
if(a[2]<=m+30)then s:=s+1;
if(a[3]<=m+30)then s:=s+1;
if(a[4]<=m+30)then s:=s+1;
if(a[5]<=m+30)then s:=s+1;
if(a[6]<=m+30)then s:=s+1;
if(a[7]<=m+30)then s:=s+1;
if(a[8]<=m+30)then s:=s+1;
if(a[9]<=m+30)then s:=s+1;
if(a[10]<=m+30)then s:=s+1;
writeln(fo,s);
close(fi);
close(fo);
end.