The problem description S01 string is initially " 0 " Transform 0 Change to 01 input format 1 integers (0~ +) output format N-transform S01 String Sample input 3 Sample Output 101 data size and conventions 0~
Remember:
The information given by the topic is misleading, so people can't see the law (1 should be "1")
The specific requirements are obtained by looking at the results of the test data (Lll¬ω¬)
That is: the string of n = (n-1 string) + (N-2 string)
AC Code:
1#include <stdio.h>2 #defineMAX 100103 4 /*default 0 is "0" and 1 is "1"*/5 Charans[ -][max] = {{"0"},{"1"},};6 voiddgintx)7 {8 if(X <2)9 {Ten return ; One } ADG (X-1); - /*the current S01 string is a combination of the first two strings*/ -sprintf (Ans[x],"%s%s", ans[x-2],ans[x-1]); the return ; - } - - intMainvoid) + { - intN; +scanf"%d",&n); A DG (n); atprintf"%s", Ans[n]); - return 0; -}
Algo-139_ Blue Bridge Cup _ algorithm training _s01 string (recursive)