Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program giacanho;
- uses crt;
- type x1=array[1..100] of integer;
- var A,B:x1; i,max,j,n:integer;
- begin
- clrscr;
- Write('Nhap so luong can ho: ');readln(n);
- For i:=1 to n do begin
- Write('Gia can ',i,' = ');readln(A[i]); end;
- B[i]:=0;
- For i:=1 to n do
- For j:=i to n do
- If A[i]=A[j] then inc(B[i]);
- Max:=B[1];
- For i:=2 to n do
- If B[i]>Max then Max:=B[i];
- For i:=1 to n do
- If Max=B[i] then
- Writeln(B[i],' ',A[i]);
- readln
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement