Editorial
Algorithm Analysis
Let n be a three-digit number. Then:
the number of its hundreds a is equal to n / 100;
the number of its tens b is equal to n / 10 % 10;
the number of its units c is equal to n % 10;
The input number n can be negative. Therefore, before finding its digits, its absolute value should be calculated.
Algorithm Implementation
Read the input value n. If it is negative, change the sign to positive.
scanf("%d", &n); if (n < 0) n = -n;
Find the digits of the number.
a = n / 100; b = n / 10 % 10; c = n % 10;
Print each digit of the number in a separate line.
printf("%d\n%d\n%d\n", a, b, c);