pascal问题 急!!!帮忙编一下!!各位高手!!!望能在端午节之前编完!!谢谢了!!!

栏目:资讯发布:2023-11-20浏览:2收藏

pascal问题 急!!!帮忙编一下!!各位高手!!!望能在端午节之前编完!!谢谢了!!!,第1张

1
var
a,b,i,m,n:longint;
t:text;
begin
a:=0;
b:=0;
readln(m);
for i:=1 to m do
begin
readln(n);
if n mod 2=0 then a:=a+n else b:=b+n;
end;
writeln(b);
writeln(a);
end
2
var
a:array[110000] of boolean;
i,j,k,n,m:longint;
f:boolean;
t:text;
procedure oo;
var
i,j,k:longint;
f:boolean;
begin
for i:=2 to 10000 do
begin
f:=false;
for j:=2 to trunc(sqrt(i)+1) do
if i mod j=0 then
begin
f:=true;
break;
end;
if f=false then a[i]:=true;
end;
end;
begin
f:=false;
readln(n);
oo;
for i:=1 to n do
begin
for j:=1 to n do
if (n-i-j>1)and(a[i]=true)and(a[j]=true) then
if a[n-i-j]=true then begin
writeln(i,' ',j,' ',n-i-j);
f:=true;
break;
end;
if f=true then break;
end;
end
3
var
a:array[1100,1100] of integer;
max,i,j,k,n,m:longint;
t:text;
begin
readln(m,n);
for i:=1 to m do
begin
for j:=1 to n do
read(a[i,j]);
readln();
end;
for i:=1 to m do
begin
for j:=1 to n do
begin
read(k);
if k=a[i,j] then inc(max);
end;
readln();
end;
writeln(max);
end

pascal问题 急!!!帮忙编一下!!各位高手!!!望能在端午节之前编完!!谢谢了!!!

1 var a,b,i,m,n:longint; t:text; begin a:=0; b:=0; readln(m); for i:=1 to m do begin readln(n); if n mod 2=0 th...
点击下载
热门文章
    确认删除?
    回到顶部