Những câu hỏi liên quan
thienlih
Xem chi tiết
chương nguyễn
Xem chi tiết
Minh Lệ
13 tháng 3 2021 lúc 13:25

Program HOC24;

var m,n,i: integer;

t1,t2: longint;

begin

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

t1:=1; t2:=1;

for i:=1 to n do t1:=t1*i;

for i:=m to n do t2:=t2*i;

writeln('T1=',t1);

write('T2=',t2);

readln

end.

Bình luận (0)
Bùi Anh Tuấn
12 tháng 3 2021 lúc 20:22

Bình luận (2)
Nghĩa Trọng
Xem chi tiết
Minh Lệ
22 tháng 3 2023 lúc 23:54

Program HOC24;

var i,n: integer;

tc,tl: longint;

begin

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

tc:=0; tl:=0;

for i:=1 to n do if i mod 2=0 then tc:=tc+i else tl:=tl+i;

writeln('Tong chan la: ',tc);

write('Tong le la: ',tl);

readln

end.

Bình luận (0)
Trương Đức Nhân
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 1 2022 lúc 13:22

Câu 1: 

uses crt;

var i,t:integer;

begin

clrscr;

t:=0;

for i:=1 to 20 do 

  if i mod 4=0 then t:=t+i;

writeln(t);

readln;

end.

Câu 2: 

uses crt;

var i,dem:integer;

begin

clrscr;

dem:=0;

for i:=1 to 20 do 

  if i mod 3=0 then dem:=dem+1;

writeln(dem);

readln;

end.

Bình luận (0)
Trương Đức Nhân
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 1 2022 lúc 22:28

Câu 1: 

#include <bits/stdc++.h>

using namespace std;

int t,i;

int main()

{

t=0;

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

if (i%4==0) t=t+i;

cout<<t;

return 0;

}

2: 

#include <bits/stdc++.h>

using namespace std;

int i,dem;

int main()

{

dem=0;

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

if ((i%2==1) and (i%3==0)) dem++;

cout<<dem;

return 0;

}

Bình luận (0)
Phạm thị thảo ly
Xem chi tiết
Đỗ Tuệ Lâm
20 tháng 3 2022 lúc 15:20

undefined

Bình luận (0)
Minh Lệ
20 tháng 3 2022 lúc 18:49

Program HOC24;

var i,n: integer;

S,P: longint;

begin

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

{..............................................}

readln

end.

-----------------------------------------------------------

Bạn điền vào {........................} theo từng bài nhé

a) S:=0; 

for i:=1 to N do if i mod 2=1 then s:=s+i;

write('S= ',s);

b)

S:=0;

for i:=1 to N do if i mod 2=0 then s:=s+i;

write('S= ',s);

c) P:=1;

for i:=1 to N do if i mod 2=0 then p:=p*i;

write('P= ',p);

d)

P:=1;

for i:=1 to N do if i mod 2=1 then p:=p*i;

write('P= ',p);

Bình luận (0)
Nguyễn Tiến  Đạt
Xem chi tiết
Nguyễn Tiến  Đạt
Xem chi tiết
Thùy Trinh Ngô
Xem chi tiết