ex.dpr
来自「tongji acm-online judge solution」· DPR 代码 · 共 34 行
DPR
34 行
program Ural_1086(Input, Output);
const
MaxN = 15000;
MaxValue = 163841;
type
TIndex = Longint;
TFilterPrime = array[1..MaxValue] of Boolean;
TPrime = array[1..MaxN] of Longint;
var
Filter: TFilterPrime;
Prime: TPrime;
CountPrime: TIndex;
i, j, T, N: TIndex;
begin
FillChar(Filter, SizeOf(Filter), true);
FillChar(Prime, SizeOf(Prime), 0);
CountPrime := 0;
for i := 2 to MaxValue do
if Filter[i] then
begin
Inc(CountPrime);
Prime[CountPrime] := i;
for j := 2 to MaxValue div i do
Filter[i * j] := false;
end;
Readln(N);
for i := 1 to N do
begin
Readln(T);
Writeln(Prime[T]);
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?