+ 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.
3 Antworten
+ 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.
+ 2
YW!
+ 1
Thanks!!!!!