• LQDOJ
  • Trang chủ
  • Bài tập
  • Bài nộp
  • Thành viên
  • Kỳ thi
  • Nhóm
  • Giới thiệu
    • Máy chấm
    • Khóa học
    • Đề xuất ý tưởng
    • Đề xuất bài tập
    • Tools
    • Báo cáo tiêu cực
    • Báo cáo lỗi

Tiếng Việt

Tiếng Việt
English

Đăng nhập

Đăng ký

luuthikhanhhuyen2007

  • Giới thiệu
  • Bài tập
  • Bài nộp

Rating
-
Bài tập
0
Điểm
0
Rating #
-
Điểm #
29197

Giới thiệu

var a: array [1..1000] of integer;
i,n,d,t,j : integer;
begin
writeln('Nhap n : ');readln(n);
for i:= 1 to n do begin
writeln;
write('a[',i,'] = ' );
readln(a[i]);
end;
t:=0;
for i:= 1 to n do
begin
d:=0;
for j:= i to n do if a[i]=a[j] then d:=d+1;
t:=t + (d div 2);
if (d>1) and (d mod 2>=1) then t:=t-(d mod 2);
end;
writeln;
writeln(t);
readln
end.


«    »
Thứ 2
Thứ 3
Thứ 4
Thứ 5
Thứ 6
Thứ 7
CN
Ít
Nhiều

proudly powered by DMOJ| developed by LQDJudge team