请帮助我,我的程序只是继续显示姓氏和数字,这是程序。我真的不明白这里有什么问题,但我确实希望你们能看到它真的需要一些帮助它杀死我的大脑
Var
Counter:Integer;
MaxValue:Integer;
NumofVotes:Array[1..4]of Integer;
ChristianName:Array[1..4]of String;
Surname:Array[1..4]of String;
WinnerFName:String;
WinnerSName:String;
WinnerParty:String;
CandidateParty: Array[1..4] of String;
begin
FOR Counter:= 1 to 4 Do
If Counter= Counter Then
begin
Writeln ('Please enter Christian name of Candidate ', Counter, ':');
Readln (ChristianName[Counter]);
Writeln ;
Writeln ('Please enter Surname of Candidate ', Counter, ':');
Readln (Surname[Counter]);
Writeln ;
Writeln ('Please enter number of votes received by Candidate ', Counter, ':');
Readln (NumOfVotes[Counter]);
Writeln ;
Writeln ('Please enter party of Candidate ', Counter, ':');
Readln (CandidateParty[Counter]);
end;
IF Counter = 1 THEN
begin
MaxValue:= NumofVotes[Counter];
WinnerFName:= ChristianName[Counter];
WinnerSName:= Surname[Counter];
WinnerParty:= CandidateParty[Counter];
end
ELSE
IF (NumofVotes[Counter]>MaxValue) THEN
begin
WinnerFName:= ChristianName[Counter];
WinnerSName:= Surname[Counter];
MaxValue:= NumofVotes[Counter];
WinnerParty:= CandidateParty[Counter]
end;
Writeln ;
Writeln ('The winner of the elections for this constituency is:');
Writeln ('FirstName: ', WinnerFName, ' Surname: ', WinnerSName);
Writeln ('From the ', WinnerParty);
Writeln (WinnerFName, ' has won with ', MaxValue, ' votes');
Writeln ;
Writeln ;
Writeln ('Press <Enter> to end');
Readln ;
end.