SHARE
TWEET

Untitled

a guest Oct 17th, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a: array of integer;
  2. n: integer;
  3.  
  4. function count(a:array of integer; b:integer) :integer;
  5. var n:integer;
  6. begin
  7. n := 0;
  8. //writeln(length(a));
  9. for var i:=1 to length(a)-1 do if a[i]=b then n := n+1;
  10. count := n;
  11. end;
  12.  
  13.  
  14. //var a :array of integer;
  15. //n :integer;
  16. begin
  17. readln(n);
  18. setlength(a, n+1);
  19. for var i:= 1 to n do readln(a[i]);
  20. writeln();
  21. for var i:=1 to n do
  22. begin
  23. if count(a, a[i]) <= 3 then writeln(a[i]);
  24. end;
  25. readln();
  26. 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
 
Top