Cunning sorting
Given a sequence of numbers. Need to streamline these numbers in non-decreasing in its last digit, and the last digit being equal - in non-decreasing numbers themselves.
Specifications
Input
The first line contains the number n ( 1 ≤ n ≤ 100 ), and the second - their own natural numbers not exceeding 32 000 .
Output
In the output file output sequence, ordered according to the condition.
@ ascii: There's only one "system" call, I'm more horrified by the spacing.
@ OP: Your code is a lot easier to read if you copy paste it from your IDE. If this is how it was written in your IDE then You should work on your spacing, it makes it easier to identify problems in your own code.
Anyhow, if I understand you're trying to sort a series of numbers by their last digit. Just read the number into an array, and then all it takes to access the last digit is to get the remainder (modulus) of the number divided by 10.