Question: Use C Fibo String Jojo is learning a series called Fibonacci series where f ib[n] = f ib[n 1] + f ib[n 2]. Jojo wondered

Use C

Fibo String Jojo is learning a series called Fibonacci series where f ib[n] = f ib[n 1] + f ib[n 2]. Jojo wondered what if this Fibonacci series was applied to characters, where S[n] = S[n 1] + S[n 2]. For example if Jojo has S[0] = a and S[1] = b then S[2] = ba, S[3] = bab, S[4] = babba and so on. Format Input Inputs start with integer T which is the number of test cases. The next T line contains the integer n, which is the n-th Fibonacci sequence in question followed by two characters S[0] and S[1]. S[0] and S[1] is guaranteed to be only 1 alphabetical letter. Format Output The answer begins with the format Case #X: S[n] where X is the number of test cases and S[n] is the n-th order Fibonacci value. Constraints 1 T 100 1 n 15 Sample Input 1 (standard input) 3 2 a b 3 a b 4 a b Sample Output 1 (standard output) Case #1: ba Case #2: bab Case #3: babba

Sample Input 2 (standard input) 3 2 c d 4 a a 2 b b Sample Output 2 (standard output) Case #1: dc Case #2: aaaaa Case #3: bb

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!