Created
May 17, 2011 16:23
-
-
Save spellancer/976784 to your computer and use it in GitHub Desktop.
For Elmira
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program Project2; | |
{$APPTYPE CONSOLE} | |
uses | |
SysUtils; | |
type tz = record | |
// group number | |
gnum:integer ; | |
group:string[8]; | |
fam:string[12]; | |
mark1:integer; | |
mark2:integer; | |
mark3:integer; | |
end; | |
var tfz,tfz2 : file of tz; | |
i,j,k:integer; | |
m:real; | |
tzz:array [1..5] of tz; | |
begin | |
writeln ('------ Menu. Choose action : ------ '); | |
// Меню . Выберите действие : | |
writeln ('====================================='); | |
writeln (' #1 A) Creating file 222.dat -- tfz = file of tz '); | |
// твой пункт А в задании и т.д . соответственно | |
writeln (' #2 B) Displaying in StringGrid data from 222.dat'); | |
writeln (' #3 C) Creating file 222.3 from file 222.dat data , containing between first excellent and first looser'); | |
writeln (' #4 D) Displaying in table StringGrid file 222.3 data'); | |
writeln (' #5 E) Sort file 222.dat by number'); | |
// выход из меню | |
writeln (' #6 Exit' ); | |
writeln; | |
writeln ('====================================='); | |
// вывод действия меню соответственно с пунктов 1-6 | |
writeln ('Input action number (1-6)'); | |
readln (k); | |
if k=1 then | |
begin | |
Assign (tfz, '222.dat'); | |
rewrite (tfz); | |
for i:=1 to 5 do | |
begin | |
// введите номер группы | |
writeln (' Input group number:'); | |
readln (tzz[i].gnum); | |
// введите группу (название) | |
writeln (' Input group :' ); | |
readln ( tzz[i].group); | |
// введите фамилию студента | |
writeln (' Input fam of student : '); | |
readln (tzz[i].fam); | |
// введите оценку 1 и т д | |
writeln( ' Input mark 1 :'); | |
readln (tzz[i].mark1); | |
writeln( ' Input mark 2 :'); | |
readln (tzz[i].mark2); | |
writeln( ' Input mark 3 :'); | |
readln (tzz[i].mark3); | |
write (tfz,tzz[i]); | |
end; | |
close (tfz); | |
end; | |
//Assign (tfz2 ; '222.3'); | |
//rewrite (tfz2); | |
// если введенный число (выбор действия ) равно 6 ( выход ) то нажать любую клавишу для выхода | |
if k=6 then writeln ('Enter something to close programm'); | |
readln; | |
{ TODO -oUser -cConsole Main : Insert code here } | |
end. |
Добавил комментарии , должно быть понятнее. написано на Delphi 7.0 , Console Aplication . Запустится на любом delphi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
вот начиная с writeln