Những câu hỏi liên quan
Bé Kunz
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:24

Bài 1: 

uses crt;

var a:array[1..200]of integer;

i,n,t:integer;

begin

clrscr;

write('Nhap 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 a[i] mod 5=0 then t:=t+a[i];

writeln('Tong cac so chia het cho 5 la: ',t);

readln;

end.

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

Bài 2: 

uses crt;

var st:string;

d,i:integer;

begin

clrscr;

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

d:=length(st);

for i:=1 to d do 

  if st[i]=#32 then delete(st,i,1);

writeln(st);

readln;

end.

Bình luận (0)
scar titan
28 tháng 7 2021 lúc 10:11

python có ko bạn

 

Bình luận (0)
Nguyễn Thị Bích Huyền
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 12 2020 lúc 19:53

uses crt;

var a:array[1..100]of integer;

i,n,max,min:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

max:=a[1];

min:=a[1];

for i:=1 to n do

  begin

if max<a[i] then max:=a[i];

if min>a[i] then min:=a[i];

end;

writeln('Gia tri lon nhat la: ',max);

writeln('Gia tri nho nhat la: ',min);

readln;

end.

Bình luận (0)
Bùi Anh Tuấn
20 tháng 12 2020 lúc 19:58

Bình luận (0)
Bao Duong
Xem chi tiết
MinhAnh Vũ
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 23:25

Bài 2:

uses crt;

var a:array[1..30]of integer;

i,n,kt:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

kt:=0;

for i:=1 to n-1 do 

 if a[i]>a[i+1] then kt:=1;

if kt=0 then write('Day so khong giam')

else writeln('Day so lon xon');

readln;

end.

Bình luận (0)
Nguyễn Quang
7 tháng 5 2021 lúc 12:16

Đề sai, ko phải lm nx, cô bảo ko thì vào đâu🙂

Bình luận (0)
An Thuyên Đỗ
Xem chi tiết
Nguyễn Lê Phước Thịnh
31 tháng 12 2022 lúc 16:20

#include <bits/stdc++.h>

using namespace std;

int n,A[100],i,k,t;

int main()

{

cin>>n>>k;

for (int i=1; i<=n; i++) cin>>A[i];

t=0;

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

if (A[i]%k==0) t+=A[i];

cout<<t;

}

Bình luận (0)
Phạm Linh
Xem chi tiết
Minh Lệ
2 tháng 5 2023 lúc 21:28

Program HOC24;

var i,n: integer;

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

begin

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

for i:=1 to n do

begin

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

end;

for i:=1 to n do if a[i]>5 then write(a[i],' ');

readln

end.

Bình luận (0)
Vàng Phan Thanh
Xem chi tiết
hoàng kim
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 23:25

Bài 1: 

uses crt;

var a:array[1..100]of integer;

i,n,min:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

min:=a[1];

for i:=1 to n do 

if min>a[i] then min:=a[i];

writeln(min);

readln;

end.

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

Bài 2: 

uses crt;

var a:array[1..100]of integer;

i,n,max:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

max:=a[1];

for i:=1 to n do 

 if max<a[i] then max:=a[i];

writeln(max);

readln;

end.

Bình luận (0)
Oanh Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 12 2020 lúc 21:00

uses crt;

var a:array[1..200]of integer;

i,n,tbc,dem:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

  end;

writeln('Cac so duong chan la: ');

for i:=1 to n do 

  if (a[i] mod 2=0) and (a[i]>0) then write(a[i]:4);

writeln;

tbc:=0;

dem:=0;

for i:=1 to n do 

  if (-1000<=a[i]) and (a[i]<=1000) then

begin

tbc:=tbc+a[i];

dem:=dem+1;

end;

writeln('Trung binh cong cac phan tu co gia tri trong pham vi tu -1000 den 1000 la: ',tbc/dem:4:2);

readln;

end.

Bình luận (0)
Thư ĐT
Xem chi tiết