SHOW:
|
|
- or go back to the newest paste.
| 1 | program p5; | |
| 2 | const | |
| 3 | n=1000; | |
| 4 | type | |
| 5 | auto = record | |
| 6 | number: string; | |
| 7 | surname: string; | |
| 8 | brand: string; | |
| 9 | end; | |
| 10 | array_record = array [1..n] of auto; | |
| 11 | var | |
| 12 | a: auto; | |
| 13 | //b: array_record; | |
| 14 | i,j: integer; | |
| 15 | procedure read_from_file; | |
| 16 | var | |
| 17 | f: text; | |
| 18 | ch: char; | |
| 19 | begin | |
| 20 | assign(f, 'C:\1.txt'); | |
| 21 | reset(f); | |
| 22 | while ch<>'.' do | |
| 23 | begin | |
| 24 | while ch<>' ' do | |
| 25 | begin | |
| 26 | i:=i+1; | |
| 27 | read(f,ch); | |
| 28 | a.number[i]:=ch; | |
| 29 | end; | |
| 30 | i:=0; | |
| 31 | while ch<>' ' do | |
| 32 | begin | |
| 33 | i:=i+1; | |
| 34 | read(f,ch); | |
| 35 | a.surname[i]:=ch; | |
| 36 | end; | |
| 37 | i:=0; | |
| 38 | while (ch<>',') or (ch<>'.') do | |
| 39 | begin | |
| 40 | i:=i+1; | |
| 41 | read(f,ch); | |
| 42 | a.brand[i]:=ch; | |
| 43 | end; | |
| 44 | i:=0; | |
| 45 | end; | |
| 46 | close(f); | |
| 47 | end; | |
| 48 | begin | |
| 49 | read_from_file; | |
| 50 | writeln(a.number); | |
| 51 | end. | |
| 52 | ||
| 53 | файл: | |
| 54 | 4568 файл правка, | |
| 55 | 1234 формат вид. | |
| 56 | ||
| 57 | ||
| 58 | строка 28 : Ошибка времени выполнения: Индекс находился вне границ массива. |