Fixed input, need to parse it now.
This commit is contained in:
parent
39c3a6fd79
commit
68979dcb01
10
.#main.adb#
10
.#main.adb#
@ -1,10 +0,0 @@
|
|||||||
with ComplexCalculator;
|
|
||||||
with Ada.Text_IO;
|
|
||||||
|
|
||||||
procedure Main is
|
|
||||||
begin
|
|
||||||
-- Your program logic goes here
|
|
||||||
|
|
||||||
-- Example: Display a message
|
|
||||||
Ada.Text_IO.Put_Line("Hello, Ada!");
|
|
||||||
end Main;
|
|
7
default.gpr
Normal file
7
default.gpr
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
project Default is
|
||||||
|
|
||||||
|
package Compiler is
|
||||||
|
for Switches ("Ada") use ("-g", "-O2");
|
||||||
|
end Compiler;
|
||||||
|
|
||||||
|
end Default;
|
26
main.adb
26
main.adb
@ -1,22 +1,30 @@
|
|||||||
with ComplexCalculator;
|
with ComplexCalculator;
|
||||||
with Ada.Text_IO;
|
with Ada.Text_IO;
|
||||||
|
|
||||||
procedure main is
|
procedure Main is
|
||||||
FirstInput : String(1..100);
|
FirstInput : String(1..10);
|
||||||
SecondInput : String(1.100);
|
SecondInput : String(1..10);
|
||||||
|
Last_Position : Natural; -- Variable to hold the last position
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
-- Your program logic goes here
|
-- Your program logic goes here
|
||||||
Ada.Text_IO.Put("Specify first imaginary number: ");
|
Ada.Text_IO.Put("Specify first imaginary number: ");
|
||||||
|
|
||||||
-- Read the user's input and store it in the UserInput variable.
|
-- Read the user's input for the first number and store it in FirstInput.
|
||||||
Ada.Text_IO.Get_Line(UserInput);
|
Ada.Text_IO.Get_Line(FirstInput, Last => Last_Position);
|
||||||
|
|
||||||
-- Display the user's input.
|
Ada.Text_IO.Skip_Line;
|
||||||
Ada.Text_IO.Put_Line("You entered: " & UserInput);
|
-- Display the user's input for the first number.
|
||||||
|
Ada.Text_IO.Put_Line("You entered: " & FirstInput);
|
||||||
|
|
||||||
|
Ada.Text_IO.Put("Specify second imaginary number: ");
|
||||||
|
|
||||||
|
-- Read the user's input for the second number and store it in SecondInput.
|
||||||
|
Ada.Text_IO.Get_Line(SecondInput, Last => Last_Position);
|
||||||
|
|
||||||
|
-- Display the user's input for the second number.
|
||||||
|
Ada.Text_IO.Put_Line("You entered: " & SecondInput);
|
||||||
|
|
||||||
-- Example: Display a message
|
-- Example: Display a message
|
||||||
Ada.Text_IO.Put_Line("Hello, Ada!");
|
Ada.Text_IO.Put_Line("Hello, Ada!");
|
||||||
end main;
|
end Main;
|
||||||
|
24
main.ali
24
main.ali
@ -1,17 +1,17 @@
|
|||||||
V "GNAT Lib v2021"
|
V "GNAT Lib v2021"
|
||||||
M P W=b
|
M P W=b
|
||||||
A -mtune=generic
|
|
||||||
A -march=x86-64
|
|
||||||
P ZX
|
P ZX
|
||||||
|
|
||||||
RN
|
RN
|
||||||
RV NO_IO
|
RV NO_IO
|
||||||
|
RV NO_DYNAMIC_SIZED_OBJECTS
|
||||||
|
|
||||||
U main%b main.adb 6afd184e NE OO SU IL
|
U main%b main.adb 0b89c4d6 NE OO SU
|
||||||
W ada%s ada.ads ada.ali
|
W ada%s ada.ads ada.ali
|
||||||
Z ada.strings.text_buffers%s a-sttebu.adb a-sttebu.ali
|
Z ada.strings.text_buffers%s a-sttebu.adb a-sttebu.ali
|
||||||
W ada.text_io%s a-textio.adb a-textio.ali
|
W ada.text_io%s a-textio.adb a-textio.ali
|
||||||
W complexcalculator%s complexcalculator.adb complexcalculator.ali
|
W complexcalculator%s complexcalculator.adb complexcalculator.ali
|
||||||
|
Z system.concat_2%s s-conca2.adb s-conca2.ali
|
||||||
|
|
||||||
D ada.ads 20210520051132 76789da1 ada%s
|
D ada.ads 20210520051132 76789da1 ada%s
|
||||||
D a-except.ads 20210520051128 946f3014 ada.exceptions%s
|
D a-except.ads 20210520051128 946f3014 ada.exceptions%s
|
||||||
@ -26,8 +26,9 @@ D a-unccon.ads 20210520051130 0e9b276f ada.unchecked_conversion%s
|
|||||||
D complexcalculator.ads 20231024191420 1e56cc72 complexcalculator%s
|
D complexcalculator.ads 20231024191420 1e56cc72 complexcalculator%s
|
||||||
D interfac.ads 20210520051132 edec285f interfaces%s
|
D interfac.ads 20210520051132 edec285f interfaces%s
|
||||||
D i-cstrea.ads 20210520051132 e53d8b8e interfaces.c_streams%s
|
D i-cstrea.ads 20210520051132 e53d8b8e interfaces.c_streams%s
|
||||||
D main.adb 20231024191028 da5f0151 main%b
|
D main.adb 20231025152734 bb2bddc9 main%b
|
||||||
D system.ads 20210520051136 2ffa5114 system%s
|
D system.ads 20210520051136 2ffa5114 system%s
|
||||||
|
D s-conca2.ads 20210520051132 02a0d7d0 system.concat_2%s
|
||||||
D s-crtl.ads 20210520051132 0ebbdb71 system.crtl%s
|
D s-crtl.ads 20210520051132 0ebbdb71 system.crtl%s
|
||||||
D s-exctab.ads 20210520051132 54135002 system.exception_table%s
|
D s-exctab.ads 20210520051132 54135002 system.exception_table%s
|
||||||
D s-ficobl.ads 20210520051132 078245e4 system.file_control_block%s
|
D s-ficobl.ads 20210520051132 078245e4 system.file_control_block%s
|
||||||
@ -46,12 +47,19 @@ D unchconv.ads 20210520051136 ca2f9e18 unchecked_conversion%s
|
|||||||
G a e
|
G a e
|
||||||
G c Z b b [main standard 4 11 none]
|
G c Z b b [main standard 4 11 none]
|
||||||
X 1 ada.ads
|
X 1 ada.ads
|
||||||
16K9*Ada 20e8 14|2r6 9r4
|
16K9*Ada 20e8 14|2r6 11r4 14r4 16r4 18r4 20r4 23r4 26r4 29r4
|
||||||
X 9 a-textio.ads
|
X 9 a-textio.ads
|
||||||
58K13*Text_IO 725e16 14|2w10 9r8
|
58K13*Text_IO 725e16 14|2w10 11r8 14r8 16r8 18r8 20r8 23r8 26r8 29r8
|
||||||
506U14*Put_Line 14|9s16
|
271U14*Skip_Line 14|16s16
|
||||||
|
463U14*Put 14|11s16 20s16
|
||||||
|
479U14*Get_Line 14|14s16 23s16
|
||||||
|
481i7 Last{natural} 14|14r37 23r38
|
||||||
|
506U14*Put_Line 14|18s16 26s16 29s16
|
||||||
X 11 complexcalculator.ads
|
X 11 complexcalculator.ads
|
||||||
1K9*ComplexCalculator 16e22 14|1w6
|
1K9*ComplexCalculator 16e22 14|1w6
|
||||||
X 14 main.adb
|
X 14 main.adb
|
||||||
4U11*main 4b11 10l5 10t9
|
4U11*Main 4b11 30l5 30t9
|
||||||
|
5a4 FirstInput{string} 14m25 18r43
|
||||||
|
6a4 SecondInput{string} 23m25 26r43
|
||||||
|
7i4 Last_Position{natural} 14m45 23m46
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user