#C14289. Add Average to Score Values
Add Average to Score Values
Add Average to Score Values
Given a string that may contain one or more occurrences of a JSON-like substring in the format "score": [a, b, c], where a, b, and c are integers, your task is to compute the average of these three numbers and append the average to the list. The average is computed as \(\frac{a+b+c}{3}\) and should be printed with one decimal place.
If no such substring exists, output the string unchanged.
Input is read from stdin and output is produced to stdout.
inputFormat
A single line containing the string to process.
outputFormat
Output the modified string after appending the average to each found "score" array. If no such array exists, print the original string.## sample
"score": [2, 3, 4]
"score": [2, 3, 4, 3.0]