pascal记录例题

[复制链接]
查看11 | 回复4 | 2009-3-20 21:51:40 | 显示全部楼层 |阅读模式
本人一pascal初学者,也是自学的。现在学到记录这儿了,本人愚笨。教材有的只是看不懂,介绍的也不太清楚。不知道那位高手赐教于我,给我个记录的例题让我明白下。当然要简单点的,也务必介绍清楚点。谢

回复

使用道具 举报

千问 | 2009-3-20 21:51:40 | 显示全部楼层
1.记录的定义:type 类型标识符=record
字段名1:类型1;
字段名2:类型2;
...
字段名n:类型n;
end;如: type
studata=record
num:string[6];
name:string[8];
sex:boolean;
s:array[1..5] of real;
end; var
student:studata;
students:array[1..10] of studata;2.记录的运用:(1)对记录中和个域的引用...
回复

使用道具 举报

千问 | 2009-3-20 21:51:40 | 显示全部楼层
数组:相同变量类型的变量的集合;记录:不同变量类型的变量的集合;(又称 结构体 或 簇)...
回复

使用道具 举报

千问 | 2009-3-20 21:51:40 | 显示全部楼层
记录的定义: type 类型标识符=record 字段名1:类型1; 字段名2:类型2; ... 字段名n:类型n; end; 如: type studata=record num:string[6]; name:string[8]; sex:boolean; s:array[1..5] of real; ...
回复

使用道具 举报

千问 | 2009-3-20 21:51:40 | 显示全部楼层
输入10 个人的生日 program shengri(input,output); type date=record year:1980..1999; month:1..12; day:1..31; var a:array[1..10] of date; i:integer; begin for i:=1 to 10 do...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行