32021-01-07 20:28:03mraronKövek (100 pont)cpp11Compilation error
Program kovek;
  const maxn=100000;
  var n,db,kell: integer;
      s,i,j: integer;
      k: array[1..maxn] of integer;
begin
  readln(n); 
  for i:=1 to n do read(k[i]);
  readln;
  s:=0;
  for i:=1 to n do s:=s+k[i];
  kell:=s div n;
  db:=n; s:=0; j:=0;
  for i:=1 to n do
  begin
    s:=s+k[i];
    if s=(i-j)*kell then 
    begin
      dec(db); s:=0; j:=i;
    end;
  end;
  writeln(db);
end.
Compilation error
exit status 1
main.cpp:5:16: error: too many decimal points in number
    5 |       k: array[1..maxn] of integer;
      |                ^~~~~~~
main.cpp:1:1: error: 'Program' does not name a type
    1 | Program kovek;
      | ^~~~~~~
main.cpp:2:9: error: 'maxn' does not name a type
    2 |   const maxn=100000;
      |         ^~~~
main.cpp:3:3: error: 'var' does not name a type
    3 |   var n,db,kell: integer;
      |   ^~~
main.cpp:4:7: error: 's' does not name a type
    4 |       s,i,j: integer;
      |       ^
main.cpp:5:8: error: found ':' in nested-name-specifier, expected '::'
    5 |       k: array[1..maxn] of integer;
      |        ^
      |        ::
main.cpp:5:7: error: 'k' does not name a type
    5 |       k: array[1..maxn] of integer;
      |       ^
main.cpp:6:1: error: 'begin' does not name a type
    6 | begin
      | ^~~~~
main.cpp:8:3: error: expected unqualified-id before 'for'
    8 |   for i:=1 to n do read(k[i]);
      |   ^~~
main.cpp:9:3: error: 'readln' does not name a type
    9 |   readln;
...