What happens in the procedure? And why the minimum is equal to 256?

0 like 0 dislike
67 views
MasToStr procedure(var a: mas; var res: string);//forming the resulting string in the array var min: integer; k: string; c: char; begin res := "; min := 256; for c := 'A' to 'Z' do if (a[c] > 0) and (a[c] < min) then begin //if letter was found min := a[c]; k := c; end; if (min < 256) then res : = ('' +k + 'was found' + min + ' times.') end;
asked by | 67 views

1 Answer

0 like 0 dislike
It is better to insert the code as code easier to read.
The procedure is passed an array. Where the indexes corresponding to the codes of the symbols lies a certain number. Judging by the context of previously counted the number of these characters. Find the symbol with the minimum number of occurrences and form the output string message about this.
As the array of apparently, the initial min is selected so that any value in it is less than it.
answered by

Related questions

0 like 0 dislike
5 answers
0 like 0 dislike
2 answers
asked Nov 12, 2018 by d1ret
0 like 0 dislike
1 answer
asked Nov 14, 2018 by mikkeyPG
0 like 0 dislike
1 answer
asked Oct 29, 2018 by glamurniy_kluben
0 like 0 dislike
1 answer
asked Nov 11, 2018 by w3bsme
24,509 questions
45,931 answers
0 comments
260 users