Запишите на языке паскаль через if программу, реализующую алгоритм работы кассира, покупателю сдачу (s) наименьшим количеством банкнот по 500 (k500), 100 (k100), 50(k50, и 10 рублей (к10) только через if
Program n1; Uses Crt; Var c: array[1..1000] of integer; n, i, null, otric, polozhit :integer; Begin writeln('Razmer massiva = '); Readln(n);
for i:=1 to n do begin c[i]:=random(40) - 20; write(c[i]:4); end;
writeln();
otric:=0; polozhit:=0; null:=0; for i:=1 to n do begin if (c[i]<0) then otric:=otric+1; if (c[i]>0) then polozhit:=polozhit+1; if (c[i]=0) then null:=null+1; end; writeln('Kol-vo chisel < 0: ', otric); writeln('Kol-vo chisel > 0: ', polozhit); writeln('Kol-vo chisel = 0: ', null); End.
Var A: array [1..10] of integer; i,b: integer; begin for i:=1 to 10 do readln(A[i]); for i:=1 to 10 do begin if A[i]=5 then writeln(i,' Строка'); end; end.
Uses Crt;
Var
c: array[1..1000] of integer;
n, i, null, otric, polozhit :integer;
Begin
writeln('Razmer massiva = '); Readln(n);
for i:=1 to n do begin
c[i]:=random(40) - 20;
write(c[i]:4);
end;
writeln();
otric:=0; polozhit:=0; null:=0;
for i:=1 to n do begin
if (c[i]<0) then otric:=otric+1;
if (c[i]>0) then polozhit:=polozhit+1;
if (c[i]=0) then null:=null+1;
end;
writeln('Kol-vo chisel < 0: ', otric);
writeln('Kol-vo chisel > 0: ', polozhit);
writeln('Kol-vo chisel = 0: ', null);
End.