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 

دو تمرین ساده. لطفا زود ....
Goto page Previous  1, 2
 
Post new topic   Reply to topic    ParsX.com Forum Index -> C/C++ Programming
View previous topic :: View next topic  
Author Message
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Thu Jan 20, 2005 5:31 pm    Post subject: Reply with quote

فتبارك الله ...
Back to top
arash
مدير بخش سي
مدير بخش سي


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

PostPosted: Mon Jan 24, 2005 10:10 am    Post subject: Reply with quote

ایمان جان حاله امیر خراب احتیاج به مرحم داره نه نمک !!! چون خودش فشار خون داره ؟؟؟
امیر جان سخت نگیر !!!
Back to top
Amir
مدير مباحث عمومي سايت


Joined: 30 Nov 2004
Posts: 1088
Location: Age Hammam Nabasham To Lebasamam

PostPosted: Thu Jan 27, 2005 9:29 am    Post subject: Reply with quote

با منی؟!

باشه بابا. حالا کی سخت گرفت. اصلا مهم نیست Wink
Back to top
arash
مدير بخش سي
مدير بخش سي


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

PostPosted: Thu Jan 27, 2005 11:20 pm    Post subject: Reply with quote

بابا شجاع !!!
من کم اورده بیدم !!!
Back to top
arash
مدير بخش سي
مدير بخش سي


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

PostPosted: Tue Mar 01, 2005 6:22 am    Post subject: Reply with quote

جواب اینو می شه بدید چرا این غلطه ؟

برنامه ای بنویسید که به صورت بازگشتی عدد را به مبنای 2 ببرد ؟

#include<stdio.h>
#include<conio.h>
int unknow(int,int);
main()
{
    int x,f=1;
    clrscr();
    printf("\n\n Enter a number:");
    scanf("%d",&x);
    f=unknow(x,f);
    printf("\n\n f=%d",f);
    getch();
    return 0;
}
int unknow(int x,int f)
{
    int d=1,m=1,h=1;
    if(x>0)
    {
     for(;h<x;m++,h*=2);
     h/=2;
     printf("\n\n d=%d , m=%d , h=%d , x=%d  f=%d\n",d,m,h,x,f);
     x-=h;
     for(;m>2;d*=10,m--);
     f+=d;
     return unknow(x,f);
    }
    return f;
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> C/C++ Programming All times are GMT + 3.5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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