Input/Output for lines of text: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) (Added 11l) |
No edit summary |
||
Line 41: | Line 41: | ||
V line = input() |
V line = input() |
||
do_stuff(line)</lang> |
do_stuff(line)</lang> |
||
=={{header|Ada}}== |
|||
<lang Ada>-- |
|||
-- The first line contains the number of lines to follow, followed by that |
|||
-- number of lines of text on STDIN. |
|||
-- |
|||
-- Write to STDOUT each line of input by passing it to a method as an |
|||
-- intermediate step. The code should demonstrate these 3 things. |
|||
-- |
|||
with Ada.Text_IO; use Ada.Text_IO; |
|||
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; |
|||
procedure Main is |
|||
Num_Lines : Integer; |
|||
begin |
|||
Get(Num_Lines); |
|||
Skip_Line; |
|||
for I in 1..Num_Lines loop |
|||
Put_Line(Get_Line); |
|||
end loop; |
|||
end Main; |
|||
</lang> |
|||
'''Input:''' |
|||
<pre> |
|||
3 |
|||
hello |
|||
hello world |
|||
Pack my Box with 5 dozen liquor jugs |
|||
</pre> |
|||
{{output}} |
|||
<pre> |
|||
hello |
|||
hello world |
|||
Pack my Box with 5 dozen liquor jugs |
|||
</pre> |
|||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |