Những câu hỏi liên quan
Nguyenquochuy
Xem chi tiết
Kiều Vũ Linh
9 tháng 3 2023 lúc 7:37

var i,n,s,du,dem:integer;

Begin

While n<=0 do

Begin

Write('N = ');readln(n);

End;

For i:=1 to n do

If n mod i = 0 then

Begin

Write(i:7);

du:=du+1;

s:=s+i;

End;

Writeln('So uoc cua ',n,' la ',du);

Writeln('Tong cac uoc cua ',n,' la ',s);

For i:=1 to s do

If s mod i = 0 then dem:=dem+1;

If dem=2 then write(s,' la so nguyen to')

Else write(s,' khong la so nguyen to');

Readln;

End.

Bình luận (1)
Gia Kỳ
Xem chi tiết
Minh Lệ
14 tháng 3 2023 lúc 21:27

Program HOC24;

var i,n,max: integer;

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

begin

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

i:=1; max:=-1;

while i<=n do

begin

write('Nhap so thu ',i,': '); readln(a[i]);

if a[i]>max then max:=a[i];

i:=i+1;

end;

write('So lon nhat la: ',max);

readln

end.

Bình luận (0)
Snsbbdbd Xnxb
Xem chi tiết
Kiều Vũ Linh
13 tháng 5 2023 lúc 8:57

Var i,n:integer;

Begin

Write('n = ');readln(n);

Write('Day so tu 1 den ',n,' la ');

For i:=1 to n do write(i:8);

Readln

End.

Bình luận (0)
Nguyễn Khải Minh
Xem chi tiết
Kiều Vũ Linh
30 tháng 4 2022 lúc 7:22

Var a:array[1..15] of integer;

i,s:integer;

Begin

I:=1;

While i<=15 do

Begin

Write('Nhap phan tu thu ',i,' = ');readln(a[i]);

s:=s+a[i];

i:=i+1;

End;

Write('Tong la ',s);

Readln;

End.

Bình luận (0)
Nguyễn Huỳnh Đổng Chi
Xem chi tiết
Phía sau một cô gái
7 tháng 4 2023 lúc 21:03

program tong_so;

var

     tong, so: integer;

begin

     tong := 0;

     while tong < 20 do

     begin

          write('Nhập số nguyên: ');

          readln(so);

          tong := tong + so;

     end;

     writeln('Tổng các số đã nhập là: ', tong);

end.

Bình luận (0)
HT.Phong (9A5)
Xem chi tiết
Trần Thị Mai Ngọc
Xem chi tiết
nguyễn an phát
18 tháng 4 2021 lúc 20:48

program tim_uoc;

uses crt;

var i,n,tong:integer;

begin

clrscr;

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

i:=1;tong:=0;

writeln('cac uoc cua ',n,' la:');

while i<=n do

if n mod i=0 then

begin

write(i:3);

inc(i);

end;

writeln;

i:=1;writeln('cac uoc chan:');

while i<=n do

begin

if n mod i=0 then 

begin

if i mod 2=0 then write(i:3);

tong:=tong+i;

end;

end;

writeln;

write('tong cac uoc chan:',tong);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
19 tháng 4 2021 lúc 19:17

uses crt;

var n,i,t:integer;

begin

clrscr;

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

i:=1;

writeln('Cac uoc cua ',n,' la: ');

while i<=n do

  begin

if n mod i=0 then write(i:4):

i:=i+1;

end;

writeln;

writeln('Cac uoc chan cua ',n,' la: ');

t:=0;

i:=1;

while i<=n do 

  begin

if (n mod i=0) then

begin

t:=t+i;

write(i:4);

end;

inc(i);

end;

writeln('Tong cac uoc chan cua ',n,' la: ',t);

readln;

end.

Bình luận (0)
HT.Phong (9A5)
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 2 2023 lúc 11:29

uses crt;

var x,lt:int64;

y,i:integer;

begin

clrscr;

readln(x,y);

lt:=1;

for i:=1 to y do

lt:=lt*i;

writeln(lt);

readln;

end.

Bình luận (0)
Nguyễn Thiên Anh
Xem chi tiết