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.

Bình luận (0)
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.

Bình luận (1)
Minh Quyết
Xem chi tiết
Phùng Tú Văn
Xem chi tiết
Sơn Mai Thanh Hoàng
20 tháng 2 2022 lúc 15:46

uses crt;

var i,n:integer;

begin

clrscr;

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

writeln('cac so chan trong khoang tu 1 toi ',n,' la:');

for i:=1 to n do

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

readln;

end.

Bình luận (1)
Trần Thị Như Quỳnh 6/4
20 tháng 2 2022 lúc 15:48

program chan;

uses crt;

var i,n:integer;

begin

clrscr;

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

for i:=1 to n do

if i mod 2=0 then write('cac so chan tu 1 den n la:');

readln

end.

Bình luận (1)

uses crt;

var i,n:integer;

begin

clrscr;

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

writeln('cac so chan trong khoang tu 1 toi ',n,' la:');

for i:=1 to n do

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

readln;

end.

nha bạn

 |~ Hok tốt ~|

Bình luận (2)
Hiếu
Xem chi tiết
Nguyễn Lê Phước Thịnh
29 tháng 3 2021 lúc 21:36

uses crt;

var s:string;

i,d,dem:integer;

begin

clrscr;

write('Nhap xau S:'); readln(s);

d:=length(s);

writeln('Cac ki tu so co trong xau S:'); 

dem:=0;

for i:=1 to d do 

  if s[i] in ['0'..'9'] then

begin

write(s[i]:4);

inc(dem);

end;

writeln;

writeln('So ki tu chu so co trong xau S: ',dem);

for i:=1 to d do 

  if s[i] in ['0'..'9'] then s[i]:='A'

writeln('Xau sau khi doi la: ',s);

readln;

end.

Bình luận (0)
Huy Phạm
Xem chi tiết
Kiều Vũ Linh
3 tháng 5 2023 lúc 6:12

1)

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

i,n,t:integer;

Begin

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

For i:=1 to n do

Begin

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

End;

For i:=1 to n do

If a[i] > a[i+1] then

Begin

t:=a[i];

a[i]:=a[i+1];

a[i+1]:=t;

End;

Write('Sap xep tang dan ');

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

Readln

End.

Bình luận (0)
Kiều Vũ Linh
3 tháng 5 2023 lúc 6:13

2)

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

i,n,t:integer;

Begin

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

For i:=1 to n do

Begin

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

End;

For i:=1 to n do

If a[i] < a[i+1] then

Begin

t:=a[i];

a[i]:=a[i+1];

a[i+1]:=t;

End;

Write('Sap xep giam dan ');

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

Readln

End.

Bình luận (0)
Lê Thùy Ánh
Xem chi tiết
KhảTâm
14 tháng 5 2021 lúc 16:20

Bài 1:program sothuc;

uses crt;

var a:array[1..10] of real;s,i,j:real;

begin

s:=0;

for i:=1 to 10 do begin writeln('A[',i,']=');readln(a[i]); end;

for i:=1 to 10 do if a[i]<0 then

for j:=1 to 10 do

begin a[j]:=sqr(a[i]); s:=s+a[j]; end;

writeln('tong binh phuong cac so am la: ',s:2:2); readln;

end. (Khi nào mình kiểm tra chạy lại trên phần mềm rồi sửa lại nếu sai nhé)

Bài 2: 

program soduong;

uses crt;

var a:array[1..100] of integer;s,i,n:integer;

begin

clrscr;

writeln('nhap do dai cua day');readln(n);

for i:=1 to n do begin

writeln('a[',i,']=');readln(a[i]);

if a[i] mod 2 = 0 then s:=s+a[i] end;

writeln('tong so duong trong day la',s:2:0);readln

end.

Bài 3: các số dương mà là số lẻ là sao thế bạn????

Bình luận (0)
 Khách vãng lai đã xóa
Hoàng Thị Mỹ Phan
Xem chi tiết
hilluu :>
Xem chi tiết
Phùng Công Anh
1 tháng 7 2023 lúc 23:22

var i, so: integer;

begin
  writeln('Nhap vao 10 so tu nhien:');
  for i := 1 to 10 do
  begin
    write('So thu ', i, ': ');
    readln(so);
    writeln('So vua nhap la: ', so);
  end;
  readln;
end.

Bình luận (0)
Đức Kiên
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 22:14

uses crt;

var st:string;

i,d,dem:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

dem:=0;

for i:=1 to d do 

  if st[i]=#32 then inc(dem);

writeln(dem);

readln;

end.

Bình luận (0)