K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

uses crt;

const fi='ktt2.inp';

var f1:text;

s:string;

a:array[1..100]of integer;

n,i,x,dem,t,kt,kt1,j,max,kt2:integer;

begin

clrscr;

assign(f1,fi);reset(f1);

readln(f1,n,x);

readln(f1,s);

for i:=1 to n do 

  read(f1,a[i]);

t:=0;

for i:=1 to n do 

  if a[i]>1 then 

begin

kt:=0;

for j:=2 to a[i]-1 do 

 if a[i] mod j=0 then kt:=1;

if kt=0 then t:=t+a[i];

end;

writeln('Tong cac so nguyen to la: ',t);

dem:=0;

for i:=1 to n do 

  if a[i]>1 then 

begin

kt1:=0;

for j:=2 to a[i]-1 do 

  if a[i] mod j=0 then kt1:=1;

if (kt1=0) and (a[i]<x) then inc(dem);

end;

writeln('So luong so nguyen to nho hon ',x,' la: ',dem);

max:=0;

for i:=1 to n do

  if a[i]>1 then 

begin

kt2:=0;

for j:=2 to a[i]-1 do 

  if a[i] mod j=0 then kt2:=1;

if (kt2=0) and (max<a[i]) then max:=a[i];

end;

if max=0 then writeln('Khong co so nguyen to nao trong day')

else writeln('So nguyen to lon nhat la: ',max);

write('Xau ',s,' theo thu tu nguoc la: ');

d:=length(s);

for i:=d downto 1 do

  write(s[i]);

writeln;

close(f1);

readln;

end.

28 tháng 4 2017

1/

program uoc;

uses crt;

var n,i,dem,x:word;

a:array[1..20] of longint;

begin

clrscr;

write('nhap so phan tu cua day:') ;readln(n);

while n>20 do

begin

write('nhap lai so phan tu thoa man toi da la 20 phan tu:');

readln(n);

end;

writeln('nhap cac phan tu cua mang:');

for i:=1 to n do

begin

write('a[',i,']='); readln(a[i]);

end;

write('nhap so nguyen x:'); readln(x);

dem:=0;

for i:=1 to n do

if x mod a[i] =0 then

begin

dem:=dem+1;

writeln(a[i],' la uoc cua ',x);

end;

if dem=0 then writeln('khong co phan tu la uoc cua ',x)

else write('co ',dem,' phan tu la uoc cua ',x);

readln;

end.banhqua

17 tháng 10 2021

nhìn mặc áo hình như trò chơi con mực đúng hông đấy là trò giết người hả

Tl :

Khong duoc viet lung tung tren dien dang

~ H T ~

30 tháng 10 2017

k thấy rõ bạn ơi

20 tháng 1 2017

o tôi xin 1 bài mẫu dạng này

à nó có updates kìa, bạn updates đi

bạn thử vào microsoft store xem

15 tháng 8 2020

Đưa lên CHH đi bạn :)