Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Kattis - T9 Spelling - C Language I need an expert to work out the code for the problem described below for me please. Thanks!
Kattis - T9 Spelling - C Language
I need an expert to work out the code for the problem described below for me please. Thanks!
T9 Spelling The Latin alphabet contains 26 characters and telephones only have ten digits on the keypad. We would like to make it easier to write a message to your friend using a sequence of keypresses to indicate the desired characters. The letters are mapped onto the digits as shown below. To insert the character 'B' for instance, the program would press 22". In order to insert two characters in sequence from the same key, the user must pause before pressing the key a second time. The space charactershould be printed to indicate a pause. For example, "2 2" indicates "AA" whereas "22" indicates "B". DEF 7 PORS tuV WAYZ Figure 1: Phone keypad Input The first line of input gives the number of cases, N,1 N 100. N test cases follow. Each case is a line of text containing the desired message, which will be at most 1000 characters long. Each message will consist of only lowercase characters 'a'-'z' and space characters.Pressing zero emits a space Output For each test case, output one line containing "Case #x"followed by the message translated into the sequence of key presses Sample Input 1 Sample Output 1 Case #1: 44 444 Case #2: 999337777 Case #3: 333666 6660 022 2777 Case #4: 443 3555 555666096667775553 4 yes foo bar hello worldStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started