All pastes #973844 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-06 10:48 UTC
rendered paste body
with priority_queue_pkg;
with Ada.Text_IO;
use Ada.Text_IO;
with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;
--with Ada.Text_IO.Integer_IO;
--use Ada.Text_IO.Integer_IO;

procedure main is
    type prior_t is (Very_Low, Low, Medium, High, Very_High);
    subtype sztring is string(1..20);
    package priorsor_p is new priority_queue_pkg(sztring,prior_t);

    n:natural;
begin
    Put_Line("Add meg hány feladatot akarsz felvenni!");
    get(n);

    declare
        psor:priorsor_p.p_sor(n);
        pr:prior_t;
        feladat:sztring;
        pr_int:natural;
        len:natural;
    begin
        for i in 1..n loop
            Put_Line("Add meg az uj feladat nevet!");
            get_line(feladat,len);
            Put_Line("Add meg a feladat prioritasat(1:Very_Low,2:Low,3:Medium,4:High,5:Very_High)!");
            get(pr_int);

            case pr_int is
                when 1 => pr:=Very_Low;
                when 2 => pr:=Low;
                when 3 => pr:=Medium;
                when 4 => pr:=High;
                when 5 => pr:=Very_High;
                when others => Put_Line("Hibas prioritast adtal meg");
            end case;
        end loop;
    end;
end main;