Advertisement
CrazyDiver

Cycles/Random nums[F]

Dec 12th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.59 KB | None | 0 0
  1. procedure ReadNums(var a,b,count:integer);
  2. begin
  3.   read(a,b,count);                      //read range borders
  4. //  readln();                    //read nums count, need to write
  5. end;  
  6. procedure WriteRandNums(a,b,count:integer);
  7. var i:integer;
  8. begin
  9.   for i:=1 to count do              //repeat 'count' times
  10.     Write(a+random(b-a+1),' ');     //write random num in range from a to b
  11. end;
  12. var count,a,b:integer;
  13. begin
  14.   ReadNums(a,b,count);              //read borders of range and count of nums,need to write
  15.   WriteRandNums(a,b,count);         //write random nums with 'count' quantity
  16. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement