#C13039. Multiply Integers in String

    ID: 42533 Type: Default 1000ms 256MiB

Multiply Integers in String

Multiply Integers in String

Given an input string S that contains both words and non-negative integers, your task is to output a modified string where every integer is multiplied by 2. All other parts of the string (such as words, spaces, and punctuation) should remain unchanged.

In formal terms, for every substring in S that represents an integer, replace it with \(2 \times \text{integer}\). The numbers appearing in the string are guaranteed to be non-negative and appear as standalone tokens (i.e. separated by non-digit characters).

Example:

Input:  3 apples and 4 oranges
Output: 6 apples and 8 oranges

inputFormat

A single line containing the string S, which may include words, spaces, and integers.

outputFormat

A single line representing the modified string where every integer has been replaced with its doubled value.## sample

3 apples and 4 oranges
6 apples and 8 oranges