Advertisement
CarlBjorklund

Tenta Uppgift 1: Tydlig

Oct 31st, 2017
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.62 KB | None | 0 0
  1. with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
  2. with Ada.Text_IO; use Ada.Text_IO;
  3.  
  4. procedure Tydlig is
  5.  
  6.    type Samling_Tecken is array (1..7) of Character;
  7.    type Samling_Siffror is array (1..7) of Integer;
  8.    Ord: Samling_Tecken;
  9.    Heltal: Samling_Siffror;
  10. begin
  11.    Ord(7):='!';
  12.    Put("Mata in ett ord (6 tecken): ");
  13.    for I in 1..6 loop
  14.       Get(Ord(I));
  15.    end loop;
  16.    Put("Mata in heltal (7 stycken): ");
  17.    for I in 1..7 loop
  18.       Get(Heltal(I));
  19.    end loop;
  20.    New_Line;
  21.  
  22.    for I in 1..7 loop
  23.       for J in 1..Heltal(I) loop
  24.          Put(Ord(I));
  25.       end loop;
  26.    end loop;
  27.  
  28.  
  29. end Tydlig;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement