int b[8] = {'3','2','3','4','5','6','7','8'};
int isAsc(int* b, int len){
if(len == 0){
return 1;
}
if(b[len] >= b[len-1]){
return isAsc(b,len-1);
}else{
return -1;
}
}
int main(){
int result = isAsc(b,7);
printf("%d", result);
getchar();
}
Judging if an array is ascendingin a recursion way
最新推荐文章于 2018-02-27 09:58:51 发布