ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

فاکتریل به صورت بازگشتی

 
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET
View previous topic :: View next topic  
Author Message
arash
مدير بخش سي
مدير بخش سي


Joined: 27 Nov 2004
Posts: 1232
Location: www.parsx.com

PostPosted: Wed Mar 02, 2005 2:51 pm    Post subject: فاکتریل به صورت بازگشتی Reply with quote

ببخشید ؟ نمی دونم ....
این برنامه فاکتریل به صورت بازگشتی هستش ولی همش جوابش یکه :


Public Function fact(X As Byte) As Byte
If X > 1 Then fact = fact(X - 1) * fact(X - 2)
fact = 1
End Function
Back to top
arash
مدير بخش سي
مدير بخش سي


Joined: 27 Nov 2004
Posts: 1232
Location: www.parsx.com

PostPosted: Thu Mar 03, 2005 8:26 pm    Post subject: Reply with quote

امیر جان ممنون مشکلم حل شد
خب شد زود تونستم پست بزنم وگرنه دوباره ضایع می شدم
درست شدش اینجوری شد

Public Function fact(X As Byte) As Long
If X >= 0 And X < 13 Then
If X >= 1 Then fact = X * fact(X - 1) Else fact = 1
Else: MsgBox ("Error !!!")
End If
End Function


یادم رفت بگم : البته بازم امیر کمکم کرد ها وگرنه درست نمی شد !!!
Back to top
unknown
مدير بخش ويژوال بيسيك
مدير بخش ويژوال بيسيك


Joined: 05 Dec 2004
Posts: 439
Location: Tehran

PostPosted: Fri Mar 04, 2005 11:43 am    Post subject: Reply with quote

آرش جان اگر خواستی پست بزنی اول مطمئن شو که درسته بعد.
چون ممکنه بچه ها دچار اشکال بشن
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Sat Mar 05, 2005 8:57 am    Post subject: Reply with quote

اين End If كه در بالا امده . مربوط به كدوم If هست ؟
Back to top
unknown
مدير بخش ويژوال بيسيك
مدير بخش ويژوال بيسيك


Joined: 05 Dec 2004
Posts: 439
Location: Tehran

PostPosted: Sat Mar 05, 2005 6:48 pm    Post subject: Reply with quote

مربوط به If اولیه است
آرش خیلی بد می نویسه...
Back to top
arash
مدير بخش سي
مدير بخش سي


Joined: 27 Nov 2004
Posts: 1232
Location: www.parsx.com

PostPosted: Sat Mar 05, 2005 10:25 pm    Post subject: Reply with quote

ااااااااااااااااااااااااا ؟؟؟
آخه چرا ؟؟؟؟
خودت گفتی وقتی IF رو تو یک خط بنویسم عین این هستش که یک دستور نوشته باشم .
مگه خودت نگفتی ؟؟؟
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum