All submissions for this problem are available.
Apologists of Wu and JIN can argue for hours proving each other that their programming language is the best one, Wu and Jin being two programming languages.
Wu people will tell that their programs are clearer and less prone to errors, while JIN people will laugh at their inability to instantiate an array of generics or tell them that
their programs are slow and have long source code.Another issue that Wu and JIN people could never agree on is identifier naming. In Wu a multiword identifier is constructed
in the following manner:the first word is written starting from the small letter, and the following ones are written starting from the capital letter, no separators are used. All other letters are small.
Examples of a WU identifier are wuIdentifier, longAndMnemonicIdentifier, name, nEERC.
Unlike them, JIN people use only small letters in their identifiers. To separate words they use underscore character ‘_’. Examples of JIN identifiers are c_identifier, ong_and_mnemonic_identifier,
name (you see that when there is just one word Wu and JIN people agree), n_e_e_r_c. You are writing a translator that is intended to translate JIN programs to Wu and vice versa. Of course,
identifiers in the translated program must be formatted due to its language rules — otherwise people will never like your translator.
The first thing you would like to write is an identifier translation routine. Given an identifier, it would detect whether it is Wu identifier or JIN identifier and translate it to another dialect.If it is
neither, then your routine should report an error. Translation must preserve the order of words.
The input consists of the several identifiers that will be given as input.
If the input identifier is Wu identifier, output its JIN version. If it is JIN identifier, output its Wu version. If it is none, output 'Error!' instead.
Input: bigNumber a BadInput best_solution Output: big_number a Error! bestSolution
|Time Limit:||0.1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PHP, GO, PERL, JS, PERL6, TEXT|
Fetching successful submissions
If you are still having problems, see a sample solution here.