Help deal with Pascal. So I made the beginning of the program and said that in order to finish it, you need to get around to the "mod", "div" help, please ... Here is what I did:

Program mass; Uses crt; var A:array [1..100] of integer; i,n,m:integer; begin clrscr; writeln('введіть кількість елементів масивів'); read(n); for i:=1 to n do begin A[i]:=random(101)-60; write(A[i],' '); end; writeln; m:=0; for i:=1 to n do if A[i]<0 then begin m:=i; break; end; write(A[m],' ','його порядковий номер = ',m); readkey; end. 

Here is the condition:

Among the array elements that are placed after its first negative element, find the number of those that end no more than 5. I would be grateful.

  • I am from Dnepropetrovsk, I know Ukrainian perfectly, but I can’t enter the sense of this shit "not more than 5" anyway ... - Vladyslav Matviienko

1 answer 1

If I understood correctly, then the last digit should be no more than 5. And then in Ukraine, the difficulties with the Russian.

 for i:=m+1 to n do if a[i] mod 10 <=5 then writeln(a[i]); 
  • one
    problems are not in Ukraine, but in Ukraine. Moreover, even in Ukraine there are no problems for the author of the topic. - sudo97