Những câu hỏi liên quan
Phạm Thị Đông Nhi_HDI
Xem chi tiết
shitbo
21 tháng 6 2020 lúc 16:54

program hello;

uses crt;

Var n,i,j,k: integer;

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

begin;

a[1]:=k;

Readln(n);

For i:=1 to n do

Begin;

Writeln('nhap a[',i,'] '); Readln(a[i]);

End;

For i:=1 to n-1 do

For j:=i+1 to n do

If a[i]<a[j] then k:=a[j];

Writeln('gia tri lon nhat la', k);

end.

Bình luận (0)
 Khách vãng lai đã xóa
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)
Phan Thị Phương Thy
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 4 2021 lúc 19:03

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('So lon nhat la: ',max);

writeln('So nho nhat la: ',min);

readln;

end.

Bình luận (0)
Minh Lệ
28 tháng 4 2021 lúc 20:26

Program HOC24;

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

i,max,min,n: integer;

begin

write('Nhap so phan tu 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 a[i]>max then max:=a[i];

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

end;

writeln('So nho nhat la :',max);

write('So lon nhat la: ',min);

readln

end.

Bình luận (0)
Nguyễn Bảo Việt
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 10 2021 lúc 0:18

Bài 2: 

#include <bits/stdc++.h>;

using namespace std;

int main();

{

long m,n;

cout<<"Nhap m="; cin>>m;

cout<<"Nhap n="; cin>>n;

cout<<m*n-2;

return 0;

}

Bình luận (0)
Quỳnh như
Xem chi tiết
Nguyễn Lê Phước Thịnh
31 tháng 10 2021 lúc 15:17

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<max(a,b);

return 0;

}

Bình luận (0)
Trần Văn Lượng
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:08

uses crt;

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

min,n,i:integer;

{----------------chuong-trinh-con-------------------}

function nn(x,y:integer):integer;

begin

if x<y then nn:=x

else nn:=y;

end;

{-----------------chuong-trinh-chinh-----------------}

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

min:=nn(a[1],a[2]);

for i:=3 to n do 

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

writeln(min);

readln;

end.

Bình luận (0)
Hoàng lĩnh
Xem chi tiết
Kiều Vũ Linh
20 tháng 3 2023 lúc 12:20

Var i,n:integer;

s:longint;

Begin

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

For i:=1 to n-1 do

If (i mod 2 = 0) and (i mod 3 = 0) then

s:=s + i;

Write('Tong la ',s);

Readln;

End.

Bình luận (0)
Nguyenthanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 5 2021 lúc 20:07

a) 

uses crt;

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

i,n,max: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];

for i:=1 to n do 

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

writeln(max);

readln;

end.

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

b) 

uses crt;

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

i,n,min:integer;

begin

clrscr;

write('Nhap 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 (0)
Thảo Linhh
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 12 2020 lúc 8:04

uses crt;

var a,b:integer;

begin

clrscr;

repeat

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

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

until (a>0) and (b>0);

if a>b then writeln(a,' la so lon hon')

else if a<b then writeln(b,' la so lon hon')

else writeln('Hai so bang nhau');

readln;

end.

Bình luận (0)
Bao Duong
Xem chi tiết