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)
Ngô Thị Tân
Xem chi tiết
Nguyễn Hoàng Duy
12 tháng 12 2023 lúc 20:17

Pascal hay C++

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
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)
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)
Quỳnh Chi Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 1 2021 lúc 13:54

uses crt;

var a,x:longint;

{------------------ham-kiem-tra-so-nguyen-to---------------}

function ktnt(x:longint):boolean;

var kt:boolean;   

i:longint;

begin   

kt:=true;   

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

if x mod i=0 then       

begin           

kt:=false;           

break;       

end;   

if kt=true then ktnt:=true   

else ktnt:=false;

end;

{---------------chuong-trinh-chinh-------------------}

begin

clrscr;

repeat 

write('Nhap a='); readln(a);

until a>10;

if ktnt(a)=true then   

begin     

x:=a;     

repeat         

a:=a div 10;         

if ktnt(a)=true then a:=a div 10;     

until a<10;     

if (ktnt(a)=true) and (a>1) then writeln(x,' la so sieu nguyen to')     

else writeln(x,' khong la so sieu nguyen to');   

end

else writeln(a,' khong la so sieu nguyen to');

readln;

end.

Bình luận (0)

bn ơi cấu hỏi hơi bị khó hiểu xíu 

Bình luận (0)
Con cò lả
Xem chi tiết
NONAME
13 tháng 2 2023 lúc 21:13

chịu

Bình luận (0)
Hoàng Văn Dũng
Xem chi tiết
Trần Văn Việt Hùng
Xem chi tiết