-- Centigrade to Farenheit temperature table
--
-- This program generates a list of Centigrade and Farenheit
-- temperatures with a note at the freezing point of water
-- and another note at the boiling point of water.
with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
procedure TempConv is
Centigrade, Farenheit : INTEGER;
begin
Put("Centigrade to Farenheit temperature table");
New_Line(2);
for Count in INTEGER range -2..12 loop
Centigrade := 10 * Count;
Farenheit := 32 + Centigrade * 9 / 5;
Put("C =");
Put(Centigrade, 5);
Put(" F =");
Put(Farenheit, 5);
if Centigrade = 0 then
Put(" Freezing point of water");
end if;
if Centigrade = 100 then
Put(" Boiling point of water");
end if;
New_Line;
end loop;
end TempConv;
019.一个略微有用的程序,摄氏度与华氏度之间的转换
最新推荐文章于 2023-02-28 00:00:45 发布