Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure Main;
- var
- Marks: TMarks;
- NoError: Boolean;
- InputFileName: string;
- InputFile, OutputFile: TextFile;
- NumberOfBadStudents: Integer;
- begin
- Writeln('This program prints number of bad students');
- Write('Enter file path: ');
- Read(InputFileName);
- if FileExists(InputFileName) then
- begin
- AssignFile(InputFile, 'input.txt');
- Reset(InputFile);
- InitArray(Marks);
- NoError := GetData(InputFile, Marks);
- CloseFile(InputFile);
- if NoError then
- begin
- NumberOfBadStudents := GetNumberOfBadStudents(Marks);
- AssignFile(OutputFile, 'output.txt');
- Rewrite(OutputFile);
- PutData(OutputFile, NumberOfBadStudents);
- PutData(NumberOfBadStudents);
- CloseFile(OutputFile);
- end;
- end
- else
- Writeln('File ', InputFileName, ' does not exist');
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement