diff --git a/.#main.adb# b/.#main.adb# deleted file mode 100644 index 0706e48..0000000 --- a/.#main.adb# +++ /dev/null @@ -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; diff --git a/default.gpr b/default.gpr new file mode 100644 index 0000000..70ec7cf --- /dev/null +++ b/default.gpr @@ -0,0 +1,7 @@ +project Default is + + package Compiler is + for Switches ("Ada") use ("-g", "-O2"); + end Compiler; + +end Default; diff --git a/main.adb b/main.adb index ad7b41b..8982d42 100644 --- a/main.adb +++ b/main.adb @@ -1,22 +1,30 @@ with ComplexCalculator; with Ada.Text_IO; -procedure main is - FirstInput : String(1..100); - SecondInput : String(1.100); +procedure Main is + FirstInput : String(1..10); + SecondInput : String(1..10); + Last_Position : Natural; -- Variable to hold the last position begin - -- Your program logic goes here Ada.Text_IO.Put("Specify first imaginary number: "); - -- Read the user's input and store it in the UserInput variable. - Ada.Text_IO.Get_Line(UserInput); + -- Read the user's input for the first number and store it in FirstInput. + Ada.Text_IO.Get_Line(FirstInput, Last => Last_Position); - -- Display the user's input. - Ada.Text_IO.Put_Line("You entered: " & UserInput); + Ada.Text_IO.Skip_Line; + -- 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 Ada.Text_IO.Put_Line("Hello, Ada!"); -end main; +end Main; diff --git a/main.ali b/main.ali index 2de3d57..5530ac2 100644 --- a/main.ali +++ b/main.ali @@ -1,17 +1,17 @@ V "GNAT Lib v2021" M P W=b -A -mtune=generic -A -march=x86-64 P ZX RN 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 Z ada.strings.text_buffers%s a-sttebu.adb a-sttebu.ali W ada.text_io%s a-textio.adb a-textio.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 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 interfac.ads 20210520051132 edec285f interfaces%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 s-conca2.ads 20210520051132 02a0d7d0 system.concat_2%s D s-crtl.ads 20210520051132 0ebbdb71 system.crtl%s D s-exctab.ads 20210520051132 54135002 system.exception_table%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 c Z b b [main standard 4 11 none] 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 -58K13*Text_IO 725e16 14|2w10 9r8 -506U14*Put_Line 14|9s16 +58K13*Text_IO 725e16 14|2w10 11r8 14r8 16r8 18r8 20r8 23r8 26r8 29r8 +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 1K9*ComplexCalculator 16e22 14|1w6 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 diff --git a/main.exe b/main.exe index 432ee82..9fbb1fb 100644 Binary files a/main.exe and b/main.exe differ diff --git a/main.o b/main.o index e1f2e9c..d6158a6 100644 Binary files a/main.o and b/main.o differ