#K74982. Camel Case to Snake Case Converter
Camel Case to Snake Case Converter
Camel Case to Snake Case Converter
You are given a single line of code containing variable declarations and assignments. In this line, some variable names are written in camelCase and you are required to convert them to snake_case. The conversion process should introduce an underscore before each uppercase letter (except when it is the first character) and then convert that letter to lowercase. The entire output should be in lowercase.
For example, the input
int myVariable = 5;
should output
int my_variable = 5;
.
Note that the code must read the input from standard input (stdin) and output the result to standard output (stdout).
inputFormat
The input consists of a single line string representing a snippet of code. The string may include one or more variable declarations separated by commas.
Example:
int myVariable = 5;
outputFormat
Output the single line of code after converting all camelCase variable names to snake_case. The transformation should ensure that every letter is in lowercase, and an underscore is inserted before a letter that was originally uppercase (if preceded by a letter or digit).
Example:
int my_variable = 5;
int myVariable = 5;
int my_variable = 5;