Những câu hỏi liên quan
Đỗ Trọng TÍn
Xem chi tiết
Kiều Vũ Linh
29 tháng 4 2023 lúc 7:52

Câu 3:

Var i,n:integer:

Begin

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

Write('Cac uoc cua n la ');

For i:=1 to n do

If n mod i = 0 then write(i:8);

Readln

End.

Kiều Vũ Linh
29 tháng 4 2023 lúc 7:56

Câu 4

Var i,n:integer:

Begin

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

Write('Cac so le nho hon n la ');

For i:=1 to n - 1 do

If i mod 2 <> 0 then write(i:8);

Readln

End.

Phong Nguyễn
Xem chi tiết
Khoa Hà
14 tháng 3 2023 lúc 21:28

Nguyễn Hoàng Duy
15 tháng 3 2023 lúc 14:59

program TongUoc;

uses crt;

var
  N, i, Tong: integer;

begin
  clrscr;
  Tong := 0;
  write('Nhap so tu nhien N: ');
  readln(N);

  // Tinh tong cac uoc cua N
  for i := 1 to N do
  begin
    if N mod i = 0 then
    begin
      Tong := Tong + i;
    end;
  end;

  writeln('Tong cac uoc cua ', N, ' la: ', Tong);

  readln;
end.

Phan Thị Ka
Xem chi tiết
Minh Lệ
19 tháng 3 2023 lúc 22:40

Câu 1:

Program HOC24;

var i,p: integer;

t: longint;

begin

write('Nhap P: '); readln(p);

t:=0;

for i:=1 to p do if i mod 2<>0 then t:=t+i;

write('Tong cac so le la: ',t);

readln

end.

Minh Lệ
19 tháng 3 2023 lúc 22:41

Câu 2:

Program HOC24;

var i,n: integer;

t: longint;

begin

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

t:=0;

for i:=1 to n do if i mod 2=0 then t:=t+i;

write('Tong cac so chan la: ',t);

readln

end.

Minh Lệ
19 tháng 3 2023 lúc 22:42

Câu 3:

Program HOC24;

var i,t,n: integer;

begin

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

t:=0;

for i:=1 to n do if n mod i=0 then t:=t+i;

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

readln

end.

aloooooooo
Xem chi tiết
Minh Lệ
19 tháng 2 2023 lúc 23:07

Program HOC24;

var i,n,d: integer;

begin

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

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

for i:=1 to n do if i mod n = 0 do then

begin write(i,' '); d:=d+1; end;

writeln;

write('Co ',d,' so la uoc cua ',n);

readln

end.

TKT VN
Xem chi tiết
nguyễn an phát
1 tháng 9 2021 lúc 11:21

program bai_1;
uses crt;
var i,n,j,d,dem:word;
begin
  clrscr;
  repeat
    write('nhap n:');readln(n);
    if (n<=0)or(n>=10000)then writeln('so ban nhap khong hop le, ban hay nhap lai:');
  until (n>0)and(n<10000);
  writeln('cac uoc so la so tu nhien cua ',n,' la:');
  for i:=1 to n do
  if n mod i=0 then write(i,'    ');
  writeln;
  dem:=0;
  for i:=2 to n do
  begin
    d:=0;
    for j:=2 to i div 2 do
    if i mod j=0 then inc(d);
    if (d=0)and(n mod i=0)then inc(dem);
  end;
  if dem>0 then writeln('cac uoc so la so nguyen to cua ',n,' la:');
  begin
    d:=0;
    for j:=2 to i div 2 do
    if i mod j=0 then inc(d);
    if (d=0)and(n mod i=0)then write(i,'    ');
  end;
  if dem=0 then write(0);
  readln;
end.

 

Hưng Quốc
Xem chi tiết
HT.Phong (9A5)
31 tháng 3 2023 lúc 16:51

1. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do write(i:3);

readln;

end.

2. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(i mod 2 = 0) then write(i:3);

readln;

end.

láobốlaos
31 tháng 3 2023 lúc 16:54

1. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do write(i:3);

readln;

end.

2. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(i mod 2 = 0) then write(i:3);

readln;

end.

Nguyễn Hoàng Duy
2 tháng 4 2023 lúc 16:31

1.

program InDaySoTuNhien;
var n, i: integer;
begin
   write('Nhap so nguyen duong n: ');
   readln(n);

   writeln('Day so tu 1 den ', n, ' la:');
   for i := 1 to n do
      write(i, ' ');
end.

2.

program InSoChan;
var
   n, i: integer;
begin
   write('Nhap so nguyen n: ');
   readln(n);

   writeln('Cac so nguyen chan trong khoang tu 1 den ', n, ' la:');
   for i := 1 to n do
   begin
      if i mod 2 = 0 then
         write(i, ' ');
   end;
end.

Nguyễn
Xem chi tiết
Nguyễn
18 tháng 5 2022 lúc 20:53

B2 tong <- 0;

B3 in tong

B4 nếu 60 mod a[i]=0; thì tong <- tong + a[i] 

B5 nhập n

Nguyễn
18 tháng 5 2022 lúc 20:54

Sắp xếp thuật toán giải bài toán trên

Viết chương trình Pascal hoàn chỉnh

Minh Lệ
18 tháng 5 2022 lúc 21:42

Program HOC24;

var i,n: integer;

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

begin

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

for i:=1 to n do

begin

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

end;

t:=0;

for i:=1 to n do if 60 mod a[i]=0 then t:=t+a[i];

write('Ket qua la: ',t);

readln

end.

mistud
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 12 2021 lúc 23:17

2:

#include <bits/stdc++.h>

using namespace std;

long long n,i;

int main()

{

cin>>n;

for (i=1; i<=n; i++)

if (n%i==0) cout<<i<<" ";

return 0;

}

Hoàng Thị Mỹ Phan
Xem chi tiết