Những câu hỏi liên quan
Quỳnh Chi Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 1 2021 lúc 19:03

uses crt;

var n,kt,snt,b,m:longint;

{-----------------------------}

procedure nhap(var a:longint);

begin   

write('nhap n:'); readln(a);

end;

{-------------------------------------------}

function ktnt(var x:longint):integer;

var kt,i,kt1,j:integer;

begin   

kt:=0;   

for i:=2 to trunc(sqrt(x)) do     

if x mod i=0 then

begin                         

kt:=1;                         

break;                       

end;   

if kt=0 then ktnt:=1   

else ktnt:=0;

end;

{-----------------------------------------------------}

BEGIN   

clrscr;   

nhap(n);   

for m:=10 to n do   

{-----------------------------------------------}   

begin     

begin       

b:=m;     

repeat         

kt:=ktnt(b);         

if kt=0 then break         

else b:=b div 10;     

until b<10;     

if (ktnt(b)=1) and (b>1) then write(m,' ')     

end;   

end; 

{-------------------------------------------------}

readln;

END.

Bình luận (0)
Nguyễn Văn Tiến Dũng
Xem chi tiết
Phía sau một cô gái
13 tháng 8 2023 lúc 8:49

program KiemTraSoSieuNguyenTo;

uses crt;

function IsPrime(num: integer): boolean;

var

   i: integer;

begin

   if num < 2 then

      IsPrime := false

   else

   begin

      IsPrime := true;

      for i := 2 to trunc(sqrt(num)) do

      begin

         if num mod i = 0 then

         begin

            IsPrime := false;

            break;

         end;

      end;

   end;

end;

function IsSuperPrime(num: integer): boolean;

var

   i, temp: integer;

begin

   IsSuperPrime := true;

   while num > 0 do

   begin

      if not IsPrime(num) then

      begin

         IsSuperPrime := false;

         break;

      end;

      temp := num mod 10;

      num := num div 10;

   end;

end;

var

   n: integer;

   inputFile, outputFile: text;

begin

   assign(inputFile, 'SNT.INP');

   assign(outputFile, 'SNT.OUT');

   reset(inputFile);

   rewrite(outputFile);

   readln(inputFile, n);

   if IsSuperPrime(n) then

      writeln(outputFile, 1)

   else

      writeln(outputFile, 0);

   close(inputFile);

   close(outputFile);

end.

Bình luận (1)
Nguyễn Hoàng Duy
14 tháng 8 2023 lúc 6:42

const fi='SNT.INP'
   fo='SNT.OUT'
var n:qword;
function isPrimeNumber(n:qword):byte;
var i:longint;
begin
   if n<2 then exit(0);
   for i:=2 to trunc(sqrt(n))do
      if n mod i=0 then exit(0);
   exit(1);
end;
function isSuperPrimeNumber(n:qword):byte;
begin
   while n<>0 do
      begin
         if isPrimeNumber(n)=0 then exit(0);
         n:=n div 10;
      end;
   exit(1);
end;
begin
   assign(input,fi);reset(input);
   assign(output,fo);rewrite(output);
      readln(n);
      write(isSuperPrimeNumber(n));
   close(output);
   close(input);
end.

 

Bình luận (0)
zzzzz
Xem chi tiết
Nguyễn phương mai
Xem chi tiết
Kiều Đông Du
Xem chi tiết
Đỗ Khánh Chi
26 tháng 10 2018 lúc 10:25

Đáp án C

Hướng dẫn: Nguyên tố vi lượng (≤ 100mg/1kg chất khô của cây) gồm:  Cl, Cu, Fe, Mn, Mo, Ni, Zn...

Tromg các phát biểu của đề bài:

Các phát biểu I, III, IV đúng

II sai vì Ca, S, K, Mg là nguyên tố đại lượng

Bình luận (0)
Trần Minh Hoàng
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 8 2020 lúc 10:30

uses crt;
var n,i,kt,dem:integer;
x,y,m,b:int32;
st,st1,st2,st3:shortstring;
{-------------chuong-trinh-con-kiem-tra-so-nguyen-to-----------------------}
function ktnt(var x:longint):integer;
var kt,i,kt1,j:integer;
begin
kt:=0;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then begin
kt:=1;
break;
end;
if kt=0 then ktnt:=1
else ktnt:=0;
end;
{-------------------------------------------}
begin
clrscr;
write('Nhap n='); readln(n);
st1[1]:='1';
for i:=2 to n do
st1[i]:='0';
st:='';
for i:=1 to n do
st:=st+st1[i];
val(st,x);
for i:=1 to n do
st2[i]:='9';
st3:='';
for i:=1 to n do
st3:=st3+st2[i];
val(st3,y);

dem:=0;
for m:=x to y do
{-----------------------------------------------}
begin
begin
b:=m;
repeat
kt:=ktnt(b);
if kt=0 then break
else b:=b div 10;
until b<10;
if (ktnt(b)=1) and (b>1) then

begin

write(m,' ');

inc(dem);

end;
end;
end;

writeln;

writeln('Co ',dem,' so sieu nguyen to co ',n,' chu so');
{-------------------------------------------------}
readln;
end.

Bình luận (0)
Minh Lệ
11 tháng 8 2020 lúc 21:06

Program HOC24;

var n: byte;

dem: integer;

i,x,x1: longint;

function nt(b: longint): boolean;

var j: longint;

begin

nt:=true;

if (b=2) or (b=3) then exit;

nt:=false;

if (b=1) or (b mod 2=0) or (b mod 3=0) then exit;

j:=5;

while j<=trunc(sqrt(b)) do

begin

if (b mod j=0) or (b mod (j+2)=0) then exit;

j:=j+6;

end;

nt:=true;

end;

function snt(a: longint): boolean;

var d,d1: byte;

begin

d:=0; d1:=0;

while a<>0 do

begin

if nt(a) then d:=d+1;

d1:=d1+1;

a:=a div 10;

end;

if d1=d then snt:=true else snt:=false;

end;

begin

write('Nhap so N: '); readln(n);

case n of

1: begin x:=1; x1:=9; end;

2: begin x:=10; x1:=99; end;

3: begin x:=100; x1:=999; end;

4: begin x:=1000; x1:=9999; end;

5: begin x:=10000; x1:=99999; end;

6: begin x:=100000; x1:=999999; end;

7: begin x:=1000000; x1:=9999999; end;

8: begin x:=10000000; x1:=99999999; end;

9: begin x:=100000000; x1:=999999999; end;

end;

dem:=0;

for i:=x to x1 do

if nt(i) then

if snt(i) then

begin

write(i,' ');

inc(dem);

end;

writeln;

write('Tat ca co ',dem,' so');

readln

end.

Bình luận (0)
Trần Minh Hoàng
6 tháng 8 2020 lúc 21:45

Ví dụ khi chạy chương trình:

Nhap so N: 4

Cac so sieu nguyen to có 4 chu so la: 2333 2339 2393 2399 2939 3119 3137 3733 3739 3793 3797 5939 7193 7331 7333 7393

Tat ca co 16 so

Bình luận (0)
Hoàng Văn Dũng
Xem chi tiết
Lê Trọng Quý
Xem chi tiết
Lê Thị Như Quỳnh
16 tháng 9 2023 lúc 12:17

nam moooooooooooooooooooooooooooooooo

 

Bình luận (0)
AUROUSFV TR
Xem chi tiết
Trần Hiếu Anh
19 tháng 3 2022 lúc 16:47

753?

Bình luận (0)
Vũ Phạm Gia Hân
19 tháng 3 2022 lúc 16:47

số 753

Bình luận (0)
Keiko Hashitou
19 tháng 3 2022 lúc 16:48

số cần tìm là 753

Bình luận (0)