Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
Program HOC24;
Var i,N: integer;
t: longint;
begin
write('Nhap dung luong ma khach hang da su dung : '); readln(N);
if N<=50 then
for i:=1 to n do t:=t+450;
if n>50 then
begin
t:=50*450;
for i:=51 to n do t:=t+500;
end;
write('Hoa don tien ma khach hang phai thanh toan cho nha cung cap dich vu la : ',t);
readln
end.
uses crt;
var n,i:integer;
t:real;
begin
clrscr;
write('Nhap so dung luong:'); readln(n);
if n<=50 then
begin
t:=0;
for i:=1 to n do
t:=t+450;
end
else begin
t:=50*450;
for i:=51 to n do
t:=t+500;
end;
writeln('Tong so tien la: ',t:0:0);
readln;
end.
uses crt;
var a:array[1..100]of integer;
n,i,min,tam,j: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('Gia tri nho nhat la: ',min);
writeln('Vi thu cua no la: ');
for i:=1 to n do
if min=a[i] then write(i:4);
writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Day so sau khi sap xep tang dan la: ');
for i:=1 to n do
write(a[i]:4);
readln;
end.
Bài 1:
uses crt;
var a:array[1..100]of integer;
i,n,tam,j:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('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
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Day so sau khi duoc sap xep tang dan la: ');
for i:=1 to n do
write(a[i]:4);
readln;
end.
Bài 2:
uses crt;
var a:array[1..100]of integer;
i,n,tam,j:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('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
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Day so sau khi duoc sap xep giam dan la: ');
for i:=1 to n do
write(a[i]:4);
readln;
end.
program TT;
uses CRT;
Var i,n:integer;
P:longint; S:Real;
begin
Write('Nhap N: '); Readln(N);
S:=0;
P:=1;
For i:=1 to N do
begin P:=P*i; S:=S+1/P; end;
Writeln('Tong S= ',S:5:3);
Readln
End.
B