题目: |
Program cz2010_1;
var a,b,c,d,n,i,j:longint;
find:boolean;
f:array[0..19]of longint;
begin
n:=-1;i:=1;
while n<19 do begin
i:=i+1;find:=false;
for j:=2 to trunc(sqrt(i)) do
if i mod j=0 then begin
find:=true;break;
end;
if not find then begin
n:=n+1;f[n]:=i;
end;
end;
readln(a,b,c,d);
n:=n+1;
a:=((f[a]*f[b]-f[c]*f[d]) mod n+n) mod n;
b:=((f[b]* f[c]-f[d]* f[a]) mod n+n) mod n;
c:=((f[c]* f[d]-f[a]* f[b]) mod n+n) mod n;
d:=((f[d]* f[a]-f[b]* f[c]) mod n+n) mod n;
writeln(a,' ',b,' ',c,' ',d);
end.
【输入】:2 3 5 7 输出:8 14 6 18
|