Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Задана последовательность n целых чисел a1, a2,..., an. Выведите количество ее элементов, равных минимальному.
- ----------------------------------------------------
- var
- a:array[1..1000000]of longint;
- min,n,i,count:longint;
- begin
- readln(n);
- count:=0;
- for i:= 1 to n do
- read(a[i]);
- ;
- min:=a[1];
- for i:= 1 to n do
- if a[i]<min then begin
- min:= a[i];
- end;
- i:=1;
- while i<=n do begin
- if a[i]=min then count:=count+1;
- i:=i+1;
- end;
- writeln(count);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement