so3fate 當前離線
Banned
thinkpanda 當前離線
係福臨門食完野嗌後數. ...
進階會員
原帖由 so3fate 於 2008-11-11 00:18 發表 #include int count_digit(int w); int main() { int x; printf("Please enter a positive integer(maximum 8 digits):"); scanf("%d",&x); printf("The number entered is %d\n",x); if (x >0 && x0) { ...
TOP
Tony仔 當前離線
原帖由 Tony仔 於 2008-11-11 01:23 發表 while (v>0) { counter=counter+1; v=v/10; return(v); } should be while (v>0) { counter=counter+1; v=v/10; } return counter;
原帖由 so3fate 於 2008-11-11 01:44 發表 試完,佢話我未initialize v?? 但我唔可以initialize wor 其實我咁return function 有冇問題 因為user 會input x 而v 只是function , 唔係x 個value.....=.=
原帖由 so3fate 於 2008-11-11 01:51 發表 initialize左就會violate user input
原帖由 so3fate 於 2008-11-11 01:56 發表 呢個programme 我define 左 x 咁user enter XXXXXXXX 8 digits 我開左個function find the number of digits 咁如果v intialize 左,可能會affect 到X