check.adb.dg

来自「This contains the following topics and m」· DG 代码 · 共 37 行

DG
37
字号

with ada;
with text_io;
use text_io;
with ada.ada__float_text_io;
use ada.ada__float_text_io;

procedure check is
   price_per_kilo : float;
   kilos_of_apples : float;
   cost : float;
begin
   price_per_kilo := (10066330.0*2**(-23));
   kilos_of_apples := (10905190.0*2**(-21));
   cost := price_per_kilo * kilos_of_apples;
   ada__text_io__put__4 ("price_per_kilo is :");
   ada__float_text_io__put__2 (price_per_kilo, fore => 
     ada__float_text_io__default_fore, aft => 
     ada__float_text_io__default_aft, exp => 
     ada__float_text_io__default_exp);
   ada__text_io__new_line__2 (spacing => 1);
   ada__text_io__put__4 ("kilos_of_apples is:");
   ada__float_text_io__put__2 (kilos_of_apples, fore => 
     ada__float_text_io__default_fore, aft => 
     ada__float_text_io__default_aft, exp => 
     ada__float_text_io__default_exp);
   ada__text_io__new_line__2 (spacing => 1);
   ada__text_io__put__4 (" the cost is:");
   ada__float_text_io__put__2 (cost, fore => 
     ada__float_text_io__default_fore, aft => 
     ada__float_text_io__default_aft, exp => 
     ada__float_text_io__default_exp);
   ada__text_io__new_line__2 (spacing => 1);
   ada__text_io__new_line__2 (spacing => 1);
   return;
end check;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?