Numbers Between Characters
Time limit2sMemory limit1024 MB
Read an integer N and a four-character string, then print N times each digit found, or N/A if there are no digits.
- Level
Easy2 of 10
- Topics
- String, Implementation, Brute force
- Solved
- No attempts yet
Problem
Write a program called nums_between_chars that reads the following input and produces the following output.
Input
The first line of the standard input contains a single integer N. The second line contains a sequence of exactly four characters with no spaces between them. Each character is a letter of the Latin alphabet or a digit.
Output
On separate lines of the standard output, the program must print the product of N with each number found in the sequence.
If the sequence contains only letters, the program must print "N/A" (without the quotes).
Constraints
- 0 ≤ N < 100