+ 1

There is no response after the launch, but just an empty window, as if I didn't write writeln, but just launched begin and end.

I wrote the code on the computer and ran it there The file is located in the same place as the project so it's not about the file and the file is definitely the right one And here is the code : begin var (min, maxinstr):=(9999999999,0); var s,maxc:string; var f:text; assign(f,'24 (1).txt'); reset(f); while not eof(f) do begin readln(f,s); if s.CountOf('G') < min then begin min:=s.CountOf('G'); for var abc := 'Z' to 'A' do begin if maxinstr < s.CountOf(abc) then begin maxc:=abc; end; end; end; end; writeln(maxc); close(f); end.

17th Sep 2023, 10:10 PM
Flasher
Flasher - avatar
3 Respuestas
+ 3
Flasher my Pascal skill is quite old and rusty. Are you missing the Program declaration statement? Also, the for loop is written to loop backward from Z to A, so it should say downto instead of to.
18th Sep 2023, 6:08 AM
Brian
Brian - avatar
+ 2
YW!
18th Sep 2023, 1:25 PM
Brian
Brian - avatar
+ 1
Thanks!!!!!
18th Sep 2023, 10:22 AM
Flasher
Flasher - avatar