Những câu hỏi liên quan
Trường
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 3 2022 lúc 23:24

uses crt;

var a,b,c,nn:integer;

//chuongtrinhcon

function min(var x,y:integer):integer;

begin

if x<y then min:=x

else min:=y;

end;

//chuongtrinhchinh

begin

clrscr;

readln(a,b,c);

nn=min(a,b);

nn=min(nn,c);

writeln(nn);

readln;

end.

phamthiminhanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 20:42

Bài 1:

uses crt;

var n,i,s:integer;

begin

clrscr;

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

s:=0;

for i:=1 to n do 

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

writeln(s);

readln;

end.

Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 20:46

Bài 2: 

uses crt;

var a,b,c,ucln,i:integer;

begin

clrscr;

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

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

write('c='); readln(c);

while a<>b do 

  begin

if a>b then a:=a-b

else b:=b-a;

end;

ucln:=a;

while ucln<>c do 

 begin

if ucln>c then ucln:=ucln-c

else c:=c-ucln;

end;

writeln(ucln);

readln;

end.

Yoriichi_Tsugikuni ( ɻɛɑ...
11 tháng 6 2021 lúc 14:55

Scratch hay java

Khách vãng lai đã xóa
huỳnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 1 2022 lúc 7:47

#include <bits/stdc++.h>

using namespace std;

long long a,b,c,ln;

int main()

{

cin>>a>>b>>c;

ln=a;

ln=max(ln,b);

ln=max(ln,c);

cout<<ln;

return 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:07

uses crt;

const fi='kiemtra.txt'

var f1:text;

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.

Nguyễn Lê Phước Thịnh
23 tháng 4 2021 lúc 20:08

Mình xin sửa lại một chút:

uses crt;

const fi='kiemtra.txt'

var f1:text;

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;

assign(f1,fi); reset(f1);

readln(f1,n);

for i:=1 to n do 

  read(f1,a[i]);

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

for i:=3 to n do 

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

writeln(min);

readln;

end.

Lê Triệu Vy
Xem chi tiết
Kiều Vũ Linh
27 tháng 5 2022 lúc 10:01

var a:[array] of integer;

i,n,max,min,s:integer;

begin

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

for i:=1 to n do

begin

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

end;

max:=a[1];

min:=a[1];

s:=0;

for i:=1 to n do

begin

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

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

s:=s+a[i];

end;

writeln('So lon nhat la ',max);

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

writeln('Tong cac phan tu trong day la ',s);

writeln('Cac so chia het cho 2 la: ');

for i:=1 to n do

if a[i] mod 2 = 0 then write(a[i],'      ');

readln;

end.

Yến Phạm
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 5 2022 lúc 10:24

uses crt;

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

i,n,t,ln,nn:integer;

begin

clrscr;

readln(n);

for i:=1 to n do readln(a[i]);

ln:=a[1];

nn:=a[1];

t:=0;

for i:=1 to n do 

begin

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

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

t:=t+a[i];

end;

writeln(ln);

writeln(nn);

writeln(t);

for i:=1 to n do 

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

readln;

end.

Bảo Nam
25 tháng 5 2022 lúc 15:36

var n,i,max,min,s: integer;

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

begin

readln(n);

for i:=1 to n do begin

readln(a[i]);

s:=s+a[i];

end;

max:=a[1]; min:=a[1];

for i:=2 to n do begin

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

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

end;

writeln('MAX=',max,'  | MIN=',min);

for i:=1 to n do if a[i] mod 2=0 then write(a[i],' '); writeln;

write('Tong = ',s);

readln

end.

lê anh tuấn
Xem chi tiết
Nhật Minh
Xem chi tiết
Văn Hải Phạm
Xem chi tiết