Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Var
- a1,a2,k,i,k10,k5,k2,k1,n:integer;
- Begin
- randomize;
- n:=random(10,20);
- writeln(n);
- writeln;
- a1 := random(10,100);
- writeln(a1);
- for i:=2 to n do
- begin
- if (a1 mod 10 = 0) then inc(k10)
- else if (a1 mod 5 = 0) then inc(k5)
- else if (a1 mod 2 = 0) then inc(k2)
- else inc(k1);
- a2:=random(10,100);
- writeln(a2);
- if (a2 mod 10 = 0) then k:=k + k10 + k5 + k2 + k1
- else if (a2 mod 5 = 0) then k:= k +k10 + k2
- else if (a2 mod 2 = 0) then k:= k + k10 + k5
- else k:= k + k10;
- a1:=a2;
- end;
- writeln;
- writeln(k);
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement