Don't like ads? PRO users don't see any ads ;-)
Guest

4

By: a guest on Jun 22nd, 2012  |  syntax: Pascal  |  size: 0.86 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. program poft_4;
  2. const
  3.   nmax=10;
  4. var
  5.   a,b:array[1..nmax] of integer;
  6.   n,j,c,i:integer;
  7.   flag:boolean;
  8. BEGIN
  9.   Repeat
  10.     Writeln('������ ������⢮ �����⮢ ���ᨢ�');
  11.     Readln(n);
  12.     if (n<1) or (n>10) then
  13.       Writeln('�訡��');
  14.   Until (n<=10) and (n>=1);
  15.   Writeln('������ ������� ���ᨢ�');
  16.   for i:=1 to n do
  17.     Read(a[i]);
  18.   Writeln;
  19.   c:=0;
  20.   for i:=1 to n do
  21.     begin
  22.       flag:=false;
  23.       j:=i+1;
  24.       while flag=false and (j<=n) do
  25.         if a[i]=a[j] then
  26.           flag:=true
  27.         else j:=j+1;
  28.       if flag=false then
  29.         begin
  30.           c:=c+1;
  31.           b[c]:=a[i];
  32.         end;
  33.     end;
  34.   writeln('��᫮ �����⮢ ��ନ஢������ ���ᨢ� =',j:2);
  35.   for i:=1 to j do
  36.     write(b[i]:3);
  37. End.