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

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: Pascal  |  size: 0.88 KB  |  hits: 16  |  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.  
  20.   c:=0;
  21.   for i:=1 to n do
  22.     begin
  23.       flag:=false;
  24.       j:=1;
  25.  
  26.       while (flag=false) and (j<=n) do
  27.         if (a[i]=a[j]) and (i<>j) then
  28.           flag:=true
  29.         else j:=j+1;
  30.  
  31.       if flag=false then
  32.         begin
  33.           c:=c+1;
  34.           b[c]:=a[i];
  35.         end;
  36.     end;
  37.  
  38.   writeln('��᫮ �����⮢ ��ନ஢������ ���ᨢ� =', c);
  39.   for i:=1 to c do
  40.     write(b[i]);
  41. End.