Write a program that inputs a cardinal N, an then inputs N numbers (may be negative). After that it outputs only first digits of these numbers (in one line). You inclined to write a subroutine "first", that accepts a number (via $a0) and returns last digit (via $v0).

As always, Captain Obvious suggests not to use arrays here. If you output your digit just after input of a number, all will look like a mess, but tests will be fine :) . Or use commandline like this: Mars prog.asm < testfile. Another variant java -jar Mars.jar path-to-prog.asm < path-to-testfile.

5
-2345
7345623
-4321
2 
7543

27427


CategoryHomework

HSE/ArchitectureASM/Homework_LeftDigits (последним исправлял пользователь FrBrGeorge 2019-11-27 12:22:59)