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.
Câu 1:
uses crt;
var a,b:integer;
begin
clrscr;
readln(a,b);
writeln((a+b)/2:4:2);
readln;
end.
{ đơn giá: a, số lượng: b}
uses crt;
var a,b,s,thanhtoan:integer;
begin
write('nhap gia don hang:');
read(a);
write('nhap so luong hang:');
s:=0;
thanhtoan:=0;
s:=a*b;
if s>100 then thanhtoan:= s*(30/100)
else thanhtoan:= s* (10/100);
write(' so tien can thanh toan la:',' ',thanhtoan);
readln;
end.
2:
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++) if (a[i]%2==0) cout<<a[i]<<" ";
return 0;
}
program sach_cua_hieu;
const
MAX_LOAI_SACH = 1000;
MIN_SO_LUONG = 1;
var
loai_sach: array[1..MAX_LOAI_SACH] of integer;
so_luong: array[1..MAX_LOAI_SACH] of integer;
n: integer;
i, max_so_luong, loai_sach_nhieu_nhat: integer;
begin
write('Nhập số loại sách: ');
readln(n);
for i := 1 to n do
begin
write('Nhập số lượng sách của loại ', i, ': ');
readln(so_luong[i]);
loai_sach[i] := i;
end;
max_so_luong := MIN_SO_LUONG;
loai_sach_nhieu_nhat := 1;
for i := 1 to n do
begin
if so_luong[i] > max_so_luong then
begin
max_so_luong := so_luong[i];
loai_sach_nhieu_nhat := i;
end;
end;
writeln('Loại sách còn nhiều nhất là loại ', loai_sach[loai_sach_nhieu_nhat]);
writeln('Số lượng còn lại là ', max_so_luong);
end.