Mn giải thích chi tiết phần chương trình chính của Code này vs ,em đang cần gấp ạ Var a,b:array[1..100] of longint; n,i,j,x,y,cs:byte; Function kt(n:longint):boolean; Var i:longint; Begin If (n=0) or (n=1) then kt:=false Else Begin i:=2; While (n mod i<>0) and (i<=sqrt(n)) do Inc(i); If i>sqrt(n) then kt:=true Else kt:=false; End; End; BEGIN Assign(input,'bai3.inp'); Reset(input); Assign(output,'bai3.out'); Rewrite(output); Readln(n); x:=1; a[x]:=0; For i:=1 to n do Begin y:=0; For j:=1 to x do for cs:=0 to 9 do If kt(a[j]*10+cs) then Begin Inc(y); b[y]:=a[j]*10+cs; End; x:=y; For j:=1 to x do a[j]:=b[j]; End; Write(x); End.

Các câu hỏi liên quan