shapes.ads
来自「Ada 2005 Training Notes.」· ADS 代码 · 共 44 行
ADS
44 行
with Geometry;package Shapes is type Circle is tagged private; function Area(C: in Circle) return Float; type Point is tagged private; function Area(C: in Point) return Float; type Triangle is tagged private; function Area(T: in Triangle) return Float;private -- Server view type Circle is new Geometry.Object with record Radius: Float; end record; function Area(C: in Circle) return Float is begin return 3.14 * C.Radius ** 2; end Area; type Triangle is new Geometry.Object with record A: Geometry.Point; B: Geometry.Point; C: Geometry.Point; end record; function Area(T: in Triangle) return Float is begin return 100.0; end Area;end Shapes;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?