内容发布更新时间 : 2024/11/15 9:42:22星期一 下面是文章的全部内容请认真阅读。
*string) { printf (\ __________ { char *string2; int size,i; size = strlen (string1); string2 = (char *) malloc (size + 1); for (i = 0; i< size; i++) string2[size+1] = ' '; printf(\{ char string[] = \ display1 (string); display2 (string); } A、int display2 (char *string) B、int display2 (char *string1) C、int display2 (char *string2) 2
下面的程序实现对字符串倒序输出。请选出应填写在空白处的选项。 int display1 (char *string) { printf (\original string is %s \\n\string); } int display2 (char *string1) { char *string2; int size,i; size = strlen (string1); string2 = (char *) malloc (size + 1); for (i = 0; i< size; i++) __________ ; string2[size+1] = ' '; printf(\string afterward is %s\\n\} int main () { char string[] = \ display1 (string); display2 (string); }
A、string2[size - i -1] = string1[i] B、string2[size - i ] = string1[i] C、string2[size - i + 1] = string1[i] D、string2[size - i ] = string1[i+1] 1