HOC24
Lớp học
Môn học
Chủ đề / Chương
Bài học
program bai1;
vả a,b,c:longint;
begin
write('Nhap so thu nhat');readln(a);
write('Nhap so thu hai);readln(b);
write('Nhap so thu ba');readln(c);
max:=a;min:=a;
if (max<b) and (min>b) then
max:=b;
min:=b;
end;
else if (max<c) and (min>c) then
max:=c;
min:=c;
else begin
max:=a;
min:=a;
writeln('So lon nhat la ',max);
writeln('So be nhat la ',min);
readln
end.
var n:longint;i,s:real;
uses crt;
var
clrscr;
write('Nhap so N=);readln(n);
s:=0;
for i:=i to n do
s:=s+sqrt(i+sqrt(i+1));
writeln('Tong la ',s);
program tg;
var a,b,c:realbegin
write('Nhap canh thu nhat ');readln(a);
write('Nhap canh thu hai');readln(b);
write('Nhap canh thu ba');readln(c);
if (a<b+c ) or (b<a+c) or (c<a+b) then writeln(;Day la ba canh tam giac')
else writeln('Day khong phai la ba canh tam giac);
program thefirstprograms;
var a,b,c:longint;
write('Nhap so thu nhat ');readln(a);
write('Nhap so thu hai ');readln(b);
write('Nhap so thu ba ');readln(c);
if (a>b) and (a>c) then writeln(a,' la so lon nhat')
else if (b>a) and (b>c) then writeln(b,' la so on nhat')
else if (c>a) and (c>b) then writeln(c,' la so lon nhat')
else (a=b=c) then writeln('Ba so bang nhau');
program firstprogams;
var r,CV,DT:real;
const pi=3.14;
write(Nhap ban kinh = ');readln(r);
CV:=2*R*pi;
DT:=r*r*3.14;
writeln('Chu vi la ',CV);
writen('Dien tch la ',DT);
readn
bài này trong SGK cũng có mà, ở VD6
B1:S<---0;i<---0;
B2:S<---S+i;i<---i+1;
B3:Nếu i\(< =\)20 thì quay lại bước 2,ngược lại thì thông báo giá trị của S và kết thúc thuật toán.