2e1c500994cb52691238d7d58e53f38e
阿里校招题目
  1. 以下函数,调用时参数 s 为 "abcde"的话, 会返回什么?

    char * test( char * s )
    {
       const int len = strlen(s);
       if(!len)
           return s;
       char tmp = ' ';
       for(int i=0,j=len-1; i!=j; ++i,--j) {
           tmp = s[i];
           s[i] = s[j];
           s[j] = tmp;
           if(i+1 == j)
               break;
       }
       return s;
    }

A. abc

B. edcab

C. ebcda

D. edcba

  1. 以下C 语言程序的输出是什么?

```c++

include

int lambda(a, b) {
if(a == 0) {
return b;
}else {
a = a - 1;
b = b + 1;
return lambda(a, b);
}
}

int mull_r(a, b) {
if(a == 0) {
return 0;
}else {
a = a - 1;
return lambda(b, mull_r(a, b)) ;
}

top Created with Sketch.