请dalao看看哪错了

P1579 哥德巴赫猜想(升级版)

Episode9 @ 2017-06-08 21:32:21

var
i,j,a,b,c,n:longint;
s:array[1..5] of longint;
t:array[1..5] of longint;
begin
a:=0;
b:=0;
c:=0;
read(n);
for i:=1 to 5 do s[i]:=0;
for j:=1 to 5 do t[i]:=0;
for i:=1 to n do
begin
for i:=a+1 to n do
   for j:=2 to i-1 do
      if i mod j<>0 then a:=i;
for i:=b+1 to n do
   for j:=2 to i-1 do
      if i mod j<>0 then b:=i;
for i:=c+1 to n do
   for j:=2 to i-1 do
      if i mod j<>0 then c:=i;
if a+b+c=n then (s[1]:=a)and(s[3]:=b)and(s[5]:=c);
if a+b+c=n then (t[1]:=a)and(t[3]:=b)and(t[5]:=c);
if t[1]<s[1] then s:=t;
if t[1]=s[1] then 
if t[3]<s[3] then s:=t;
end;
write(t[1],' ',t[3],' ',t[5]);
end.

by binbang @ 2017-06-08 22:14:47

我是C++的,看不懂啊


by Omphalos @ 2017-07-02 11:49:04

Me too.


|