Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- phi.adb
- with Ada.Text_IO, Ada.Integer_Text_IO;
- use Ada.Text_IO, Ada.Integer_Text_IO;
- procedure phi is
- a : Integer;
- b : Integer;
- function phi_func (n, o : Integer) return Integer is
- begin
- if n = 0 then
- return (o + 1);
- elsif o = 0 then
- return (phi_func (n - 1, 1));
- else
- return (phi_func (n - 1, phi_func (n, o - 1)));
- end if;
- end phi_func;
- begin
- Put ("Gib eine Zahl fuer a ein! a = ");
- Get (a);
- Put ("Gib eine Zahl fuer b ein! b = ");
- Get (b);
- Put (phi_func (a, b));
- end phi;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement