SHARE
TWEET

Untitled

a guest Oct 17th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a: array of integer;
  2. n, i: integer;
  3.  
  4. function count(a:array of integer; b:integer) :integer;
  5. var i, n:integer;
  6. begin
  7. n := 0;
  8. for i:=1 to length(a) do if a[i]=b then n := n+1;
  9. count := n;
  10. end;
  11.  
  12.  
  13. //var a :array of integer;
  14. //n :integer;
  15. begin
  16. readln(n);
  17. setlength(a, n+1);
  18. for i:= 1 to n do readln(a[i]);
  19. writeln();
  20. for i:=1 to n do
  21. begin
  22. if count(a, a[i]) <= 3 then writeln(a[i]);
  23. end;
  24. readln();
  25. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top