标签:注释 ges blog stdio.h alt button 输出 for log
Sample 1 5 abcde
Sample 2 1 a
样例输出
Sample 1
ebcda
edcba
edcba
Sample 2
a
作者注释:按照题目要求编译到结果都没问题,但提交不过,蛋疼。
1 #include<stdio.h> 2 void daozhi(int begin,int end,char s[]){ 3 if(begin>=end) return; 4 else{ 5 char temp; 6 temp = s[begin]; 7 s[begin] = s[end]; 8 s[end] = temp; 9 printf("%s\n",s); 10 daozhi(begin+1,end-1,s); 11 } 12 13 } 14 int main(){ 15 int len; 16 char s[10000]; 17 scanf("%d%s",&len,&s); 18 daozhi(0,len-1,s); 19 for(int i=0;i<len;i++){ 20 printf("%c",s[i]); 21 } 22 return 0; 23 }
标签:注释 ges blog stdio.h alt button 输出 for log
原文地址:http://www.cnblogs.com/panweiwei/p/6612899.html