Pascal: const n = 10; var a:array [1..n] of integer; i,max,c:integer; begin clrscr; readln (a[1]); max:=a[1]; c:=1; for i:=2 to n do begin readln (a[i]); if a[i]>max then begin max:=a[i]; c:=1; end else if a[i]=max then inc(c); end; writeln ('Kol-vo: ',c); end.
C++: #include <iostream> using namespace std;
int main() { int a[10]; int c = 0,max; cin >>a[0]; max = a[0]; for (int i = 1; i<10; i++) { cin >>a[i]; if (a[i]>max) { max = a[i]; c = 1; } else if (a[i]==max) ++c; } cout <<"KOL_VO: " <<c <<endl; return 0; }
const n = 10;
var a:array [1..n] of integer;
i,max,c:integer;
begin
clrscr;
readln (a[1]);
max:=a[1];
c:=1;
for i:=2 to n do
begin
readln (a[i]);
if a[i]>max then
begin
max:=a[i];
c:=1;
end
else if a[i]=max then inc(c);
end;
writeln ('Kol-vo: ',c);
end.
C++:
#include <iostream>
using namespace std;
int main()
{
int a[10];
int c = 0,max;
cin >>a[0];
max = a[0];
for (int i = 1; i<10; i++)
{
cin >>a[i];
if (a[i]>max)
{
max = a[i];
c = 1;
}
else if (a[i]==max)
++c;
}
cout <<"KOL_VO: " <<c <<endl;
return 0;
}