Những câu hỏi liên quan
Ái Cầm Trần
Xem chi tiết
Phú Lưu
Xem chi tiết
Kiều Vũ Linh
20 tháng 4 2022 lúc 14:52

Var a:array[1..20] of integer;

max,min:integer;

tbc:real;

Begin

For i:=1 to 20 do

Begin

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

End;

Max:=a[1];

Min:=a[1];

For i:=2 to 20 do

Begin

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

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

End;

tbc:=(max+min)/2;

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

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

Write('Trung binh cong la ',tbc:10:2);

Readln;

End.

Bình luận (0)
Phú Lưu
Xem chi tiết
Kiều Vũ Linh
20 tháng 4 2022 lúc 14:51

Var a:array[1..20] of integer;

max,min:integer;

tbc:real;

Begin

For i:=1 to 20 do

Begin

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

End;

Max:=a[1];

Min:=a[1];

For i:=2 to 20 do

Begin

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

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

End;

tbc:=(max+min)/2;

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

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

Write('Trung binh cong la ',tbc:10:2);

Readln;

End.

Bình luận (0)
Phước Thiện Lê Hoàng
Xem chi tiết
Nguyễn Lê Phước Thịnh
22 tháng 4 2021 lúc 21:27

1:

uses crt;

const fi='ketqua.txt'

var f1:text;

st:string;

i,d:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

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

d:=length(st);

for i:=1 to d do 

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

writeln(f1,st);

close(f1);

end.

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

2:

uses crt;

var a,b,c,d:integer;

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

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

begin

if x<y then min:=x

else min:=y;

end;

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

begin

clrscr;

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

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

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

write('d='); readln(d);

writeln(min(a,min(b,min(c,d))));

readln;

end.

Bình luận (1)
Ánh sao
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 4 2021 lúc 20:15

Câu 1: 

uses crt;

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

max,i:integer;

begin

clrscr;

for i:=1 to 5 do 

  begin

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

end;

max:=a[1];

for i:=1 to 5 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 4 2021 lúc 20:16

Câu 2: 

uses crt;

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

min,i:integer;

begin

clrscr;

for i:=1 to 6 do 

  begin

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

end;

min:=a[1];

for i:=1 to 6 do 

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

writeln(min);

readln;

end.

Bình luận (0)
Trúc Anh
Xem chi tiết
Đình Hải
27 tháng 12 2022 lúc 0:23

uses crt;

var a,b,c,max:integer;

begin

clrscr;

write('nhap ba so:');readln(a,b,c);

if a mod 2=0 then writeln(a,' la so chan')

else writeln(a,'la so le);

if b mod 2=0 then writeln(b,'la so chan')

else writeln(b,'la so le');

if c mod 2=0 then writeln(c,'la so chan')

else writeln(c,'la so le');

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln('so lon nhat trong ba so la:',max);

readln

end.

 

 

Bình luận (0)
Hàn Nhật Hạ
Xem chi tiết
Uyên  Thy
15 tháng 3 2022 lúc 23:45

Tham khảo nhen
Program Tin_hoc;

var a: integer;

begin

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

if a=0 then write('a la so 0') else

if a mod 2=0 then write(a,' la so chan') else write(a,' la so le');

readln

end.

Bình luận (0)
kodo sinichi
16 tháng 3 2022 lúc 5:54

Tham khảo


Program Tin_hoc;

var a: integer;

begin

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

if a=0 then write('a la so 0') else

if a mod 2=0 then write(a,' la so chan') else write(a,' la so le');

readln

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
16 tháng 3 2022 lúc 7:28

Câu 2:

#include <bits/stdc++.h>

using namespace std;

long long i;

int main()

{

for (i=1; i<=20; i++) cout<<i<<" ";

return 0;

}

Bình luận (0)
Nguyễn Mỹ Uyên
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 12 2021 lúc 13:31

uses crt;

var a,b,c:longint;

begin

clrscr;

readln(a,b,c);

writeln(a*b*c);

readln;

end.

Bình luận (0)
Yết Thiên
Xem chi tiết
Trúc Giang
12 tháng 5 2021 lúc 9:55

Câu 2:

Program nii;

Uses crt;

Var a,b,c,A:integer;

Begin

Write ('nhap a');

Readln (a);

Write ('nhap b');

Readln (b);

Write ('nhap c');

Readln (c);

A:=a;

If A<b then A:=b;

If A<c then A:=c;

Write ('Ket qua',A);

Readln;

End.

Bình luận (0)
Trúc Giang
12 tháng 5 2021 lúc 9:51

Câu 1

Program ntg;

Uses crt;

Var A,x,y:integer;

Begin

Write ('nhap x');

Readln (x);

Write ('nhap y');

Readln ('y');

A:=x+y;

Write ('Ket qua',A);

Readln;

End.

 

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

Câu 2: 

uses crt;

var a,b,c,max:integer;

begin

clrscr;

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

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

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

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln('So lon nhat trong 3 so la: ',max);

readln;

end.

Bình luận (1)
Đoàn Phạm Phương Vy
Xem chi tiết