In PascalABC, a sequence of integers is given, in this sequence there are two zeros, they are located

In PascalABC, a sequence of integers is given, in this sequence there are two zeros, they are located in different places, you need to find the number of numbers between these zeros.

program zz1;
var a, k1, k2, i, s, n: integer; // set variables of integer type
begin
write (‘enter n’); // enter the number of sequence numbers from the keyboard
read (n);
for i: = 1 to n do // organize a loop
begin
read (a); // enter the number of the sequence
if (a = 0) and (s = 0) then begin k1: = i; s: = 1; end; // find the number of the first zero
if (a = 0) and (s = 1) then k2: = i; // find the number of the second zero
end;
write (‘the number of numbers between zeros =’, k2 – k1 – 1); // display the answer
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.