Những câu hỏi liên quan
phamthiminhanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 20:42

Bài 1:

uses crt;

var n,i,s:integer;

begin

clrscr;

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

s:=0;

for i:=1 to n do 

 if i mod 6=0 then s:=s+i;

writeln(s);

readln;

end.

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

Bài 2: 

uses crt;

var a,b,c,ucln,i:integer;

begin

clrscr;

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

write('b='); readln(b);

write('c='); readln(c);

while a<>b do 

  begin

if a>b then a:=a-b

else b:=b-a;

end;

ucln:=a;

while ucln<>c do 

 begin

if ucln>c then ucln:=ucln-c

else c:=c-ucln;

end;

writeln(ucln);

readln;

end.

Bình luận (0)
Yoriichi_Tsugikuni ( ɻɛɑ...
11 tháng 6 2021 lúc 14:55

Scratch hay java

Bình luận (0)
 Khách vãng lai đã xóa
Quỳnh Hoa
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 10 2021 lúc 23:22

#include <bits/stdc++.h>

using namespace std;

long n,i,dem,t;

int main()

{

cin>>n;

dem=0;

t=0;

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

if (n%i==0) 

{

dem++;

t=t+i;

}

cout<<dem<<" "<<t;

return 0;

}

Bình luận (0)
Kamato Heiji
Xem chi tiết
Nguyễn Lê Phước Thịnh
16 tháng 3 2021 lúc 21:34

1:

uses crt;

var i,j,t,kt:integer;

begin

clrscr;

t:=0;

for i:=1 to 100 do 

  if i>1 then 

begin

kt:=0;

for j:=2 to i-1 do 

  if i mod j=0 then kt:=1;

if kt=0 then t:=t+i;

end;

writeln(t);

readln;

end.

Bình luận (4)
Nguyễn Lê Phước Thịnh
16 tháng 3 2021 lúc 21:35

Câu 2: 

*Viết chương trình:

uses crt;

var n,p,t:integer;

begin

clrscr;

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

t:=0;

for p:=2 to n-1 do 

  if n mod p=0 then t:=t+p;

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

readln;

end.

Bình luận (0)
Yoriichi_Tsugikuni ( ɻɛɑ...
11 tháng 6 2021 lúc 14:57

Dễ mà bạn tự làm đi

Bình luận (0)
 Khách vãng lai đã xóa
Lê Đăng Khôi
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 2 2023 lúc 15:39

1:

uses crt;

var t,x,i,n:integer;

begin

clrscr;

t:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

t:=t+x;

end;

write(t);

readln;

end.

2: 

uses crt;

var dem,x,i,n:integer;

begin

clrscr;

dem:=0;

n:=10;

for i:=1 to n do

begin

readln(x);

if x mod 2=0 then inc(dem);

end;

write(dem);

readln;

end.

Bình luận (1)
Lê Chiêu Nguyên	Vũ
4 tháng 4 2023 lúc 10:18

3

program Cacsole;
uses crt;
var M, N, i: integer;
begin
clrscr;
write ('Nhap M= '); readln(M);
write ('Nhap N= '); readln(N);
for i := M to N do

if  i mod 2 = 1 then
write (i,' ');
readln;
end.

Bình luận (1)
Lâm Khả Doanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 2 2023 lúc 22:28

1:

uses crt;

var n,i,t:integer;

begin

clrscr;

readln(n);

t:=0;

for i:=1 to n do

t:=t+i*i;

write(t);

readln;

end.

Bình luận (0)
Lê Chiêu Nguyên	Vũ
4 tháng 4 2023 lúc 10:21

2

program bt2;

var i,n,t:integer;

begin

readln(n);

s:=0;

for i:=1 to n do

if i mod 2 = 1 then s:=s+i;

readln;

end.

Bình luận (0)
hoàng phong Lương
Xem chi tiết
Nguyễn Hoàng Duy
19 tháng 3 2023 lúc 22:45

program TongChuSo;
var
    n, sum: integer;
begin
    write('Nhap n: ');
    readln(n);
    sum := 0;
    while n > 0 do
    begin
        sum := sum + (n mod 10);
        n := n div 10;
    end;
    writeln('Tong cac chu so cua n la: ', sum);
    readln;
end.

 

Bình luận (0)
Hoangg Anhh
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 4 2021 lúc 20:40

uses crt;

var n,i,t:integer;

begin

clrscr;

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

t:=0;

for i:=1 to n do

  if n mod i=0 then

begin

write(i:4);

t:=t+i;

end;

writeln;

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

readln;

end.

Bình luận (0)
Phong
Xem chi tiết
Phía sau một cô gái
23 tháng 3 2023 lúc 19:38

program Tim_Uoc;

uses crt;

var

     n, i: integer;

begin

     clrscr;

     write('Nhap vao mot so nguyen duong n: ');

     readln(n);

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

     for i:=1 to n do

     begin

          if n mod i = 0 then

               writeln(i);

     end;

     readln;

end.

Bình luận (2)
Ét o Ét :(
Xem chi tiết