Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
What happens in the procedure? And why the minimum is equal to 256? - bug-code.com Q&A

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

0 like 0 dislike
184 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 | 184 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
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers

0 comments

12.8k users

24,788 questions
46,220 answers
0 comments
12,801 users