作者hicoy ()
站內TransCSI
標題[問題] 一題程式
時間Sun Jul 3 14:23:33 2005
#include<stdio.h>
void somefunction(const int b[],int c);
int main(){
int a[]={1,3,5,7,9,11};
somefunction(a,5);
return 0;
}
void somefunction(const int b[],int c){
if(c>0){
somefunction(&b[1],c-1);
printf("%d\n",b[0]);
}
}
請問一下答案
這是我做出來的不過我不確定
9
7
5
3
1
請問這樣對嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.166.129.192
推 E9E7:我跑出來跟你寫的一樣,應該對了吧^^"220.135.213.145 07/03
推 neutronstars:這是考古題嗎?我覺得這題還滿有趣的~ 218.35.186.6 07/03
推 hicoy:這是台聯大93年計概題目218.166.130.178 07/03