Những câu hỏi liên quan
Công danh
Xem chi tiết
Trúc Giang
18 tháng 1 2021 lúc 19:54

Program mun;

Uses crt;

Var i:integer;

Begin

For i:=1 to 10 do write ('2 × ', i,' = ', 2*i);

Readln;

End.

P/s: Ko chắc ạ!

Bình luận (0)
Nguyễn Lê Phước Thịnh
18 tháng 1 2021 lúc 21:28

uses crt;

var i:integer;

begin

clrscr;

for i:=1 to 10 do

writeln('2*',i,'=',2*i);

readln;

end.

Bình luận (0)
Linh Nhi
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 3 2022 lúc 9:22

a: uses crt;

var i,n:integer;

s:real;

begin

clrscr;

s:=0;

for i:=1 to 100 do s:=s+1/i;

writeln(s:4:2);

readln;

end.

b: 

uses crt;

var i,n:integer;

s:real;

begin

clrscr;

s:=0;

i:=0;

while i<=100 do 

begin

inc(i);

s:=s+1/i;

end;

writeln(s:4:2);

readln;

end.

Bình luận (0)
Ngân
Xem chi tiết
ILoveMath
3 tháng 3 2022 lúc 9:21

For...do:

var s,i: integer;

begin

readln(s,i);

s:=0;

For i:=3 to 99 do

If i mod 3 = 0 do s:=s+i;

write(s)

readln;

end.

while ... do:

Var i,S:integer;

Begin

Readln(i,s);

S:=0;

i:=3;

while i<=99 do

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

write(s);

Readln;

End.

Bình luận (0)
 ILoveMath đã xóa
ILoveMath
3 tháng 3 2022 lúc 10:29

For...do:

var s,i: integer;

begin

readln(s,i);

s:=0;

For i:=3 to 99 do

If i mod 3 = 0 do s:=s+i;

write(s);

readln;

end.

while ... do:

Var i,S:integer;

Begin

Readln(i,s);

S:=0;

i:=3;

while i<=99 do

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

write(s);

Readln;

End.

Bình luận (0)
Blink
Xem chi tiết
Kiều Vũ Linh
7 tháng 2 2022 lúc 14:24

var i,n:integer;

s:real;

begin

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

for i:=1 to n do

s:=s+1/(3*i+2);

write('Tong la ',s:10:2);

readln;

end.

Bình luận (0)
Khánh Hoàng
Xem chi tiết
Thanh Phong (9A5)
6 tháng 3 2023 lúc 18:09

Uses crt;

var s,n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(n mod 2<>0) then s:=s+i;

writeln(s);

readln;

end.

Bình luận (3)
Khánh Hoàng
Xem chi tiết
Minh Lệ
7 tháng 3 2023 lúc 22:51

Program HOC24;

var i,n: integer;

S: longint;

begin

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

i:=2; s:=0;

while i<=n do

begin

s:=s+i;

i:=i+2;

end;

write('S=',S);

readln

end.

Bình luận (0)
Nguyễn Hoàng Duy
19 tháng 3 2023 lúc 22:42

program TongCacSoChan;
var
    n, s, i: integer;
begin
    write('Nhap n: ');
    readln(n);
    s := 0;
    i := 2;
    while i <= n do
    begin
        s := s + i;
        i := i + 2;
    end;
    writeln('Tong cac so chan la: ', s);
    readln;
end.

 

Bình luận (0)
Tùng Dương
Xem chi tiết
nguyễn an phát
27 tháng 5 2021 lúc 13:35

program tong_for_to_do;

uses crt;

var i,n:integer;

t:real;

begin

clrscr;

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

t:=0;

for i:=1 to n do

if i mod 3=0 then t:=t+1/i;

writeln('tong la: ',t);

readln;

end.

Bình luận (0)
nguyễn an phát
27 tháng 5 2021 lúc 13:37

program tong_while_do;

uses crt;

var i,n:integer;

t:real;

begin

clrscr;

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

t:=0;i:=3;

while i<=3*n do

begin

t:=t+1/i;

i:=i+3;

end;

writeln('tong la: ',t);

readln;

end.

Bình luận (0)
Le Thi Thao Van
Xem chi tiết
Lê Anh Tú
28 tháng 6 2018 lúc 14:20

Lập chương trình Pascal để in bảng cửu chương ra màn hình.

Uses crt;
Var
a:array[1..9,1..9] of Integer ;
i,j:byte ;
BEGIN
Clrscr ;
For i := 1 to 9 do
For j := 1 to 9 do
A[i,j] := i*j ;
For i := 1 to 9 do
Begin
For j := 1 to 9 do Write(a[i,j]:5);
Writeln ;
Writeln ;
End ;
Readln ;
END.
Bình luận (1)
Le Thi Thao Van
28 tháng 6 2018 lúc 9:22

Mọi người giúp em với :<<

Bình luận (0)
Trí Cao
Xem chi tiết
Kiều Vũ Linh
17 tháng 3 2022 lúc 9:18

* Sử dụng For ... do

Var i,s:integer;

Begin

For i:=1 to 10 do

s:=s+i;

Write('Tong la ',s);

Readln;

End.

* Sử dụng While ... do

Var i,s:integer;

Begin

i:=1;

While i<=10 do

Begin

s:=s+i;

i:=i+1;

End;

Write('tong la ',s);

Readln;

End.

Bình luận (0)