+
1 10 10

:

  1. #1
    G007       G007
    24.08.2007
    1,192
    ()
    0
    : 0 (: 0).





    1





    struct list .... int val; list *next,*pred; };

    //------------------------------------------------------- 1

    int F1(list *p)

    .... int n;

    for (n=0; p!=NULL; p=p->next, n++);

    return n; }

    //------------------------------------------------------- 2

    list *F2(list *ph, int v)

    .... list *q = new list;

    q->val = v; q->next = ph; ph = q;

    return ph; }





    2





    long F1(int n)

    .... if (n==1) return 1;

    return (n * F1(n-1)); }

    //------------------------------------------------------ 2

    double F2(double *pk, double x, int n)

    ....

    if (n==0) return(*pk);

    return *pk + x *F2(pk+1,x,n-1);

    }

    void z3()

    .... double B[] ={ 5.,0.7,4.,3. } ,X=3., Y;

    Y = F2(B,X,4); }






    3




    tree A1={"aaa",NULL,NULL,NULL,NULL};

    tree A2={"bb",NULL,NULL,NULL,NULL};

    tree A3={"cccc",&A1,&A2,NULL,NULL};

    tree A4={"dd",NULL,NULL,NULL,NULL};

    tree A5={"aaa",NULL,NULL,NULL,NULL};

    tree A6={"fff",&A3,&A4,&A5,NULL};

    void main()

    .... printf("F=%d\n",F(&A6)); } //



    //------------------------------------------------------37-16.cpp

    //-------------------------------------------------------1

    struct xxx .... int v; xxx *p[4]; };

    int F1(xxx *q)

    .... int i,n,m;

    if (q==NULL) return 0;

    for (n=F1(q->p[0]),i=1; i< 4; i++)

    if ((m=F1(q->p[i])) >n) n=m;

    return n+1; }

    //-------------------------------------------------------2

    struct zzz .... int v; zzz *l,*r; };

    int F2(zzz *p) ....

    if (p==NULL) return(0);

    return (1 + F2(p->r) + F2(p->l)); }






    4




    double F1(double a, double b, double (*pf)(double))

    .... double m;

    if ((*pf)(a) * (*pf)(b) > 0 )return(a);

    while ( b-a > 0.0001 ) ....

    m = (b + a)/2;

    if ((*pf)(a) * (*pf)(m) < 0) b=m; else a=m;

    }

    return a ;}

    //------------------------------------------------------- 2

    double F2(double x, double s0, double (*pf)(double,int))

    .... double s; int n;

    for (n=1, s=0.0; fabs(s0) > 0.0001; n++)

    .... s += s0; s0 = s0 * (pf)(x,n); }

    return s; }

    double ff(double x, int n) .... return( x/n); }

    void main1()

    .... double x,y; y = F2(x,1,ff); }




    5//------------------------------------------------------ 1

    struct man {char name[20]; int dd,mm,yy; char *addr; };

    char *F1(char *p, char *nm, char *ad)

    .... man *q =(man*)p;

    strcpy(q->name,nm);

    strcpy((char*) (q+1 ),ad);

    q->addr = (char*) (q+1 );

    for (p=(char*) (q+1 ); *p!=0; p++);

    p++; return p;}

    //------------------------------------------------------ 2

    struct man1 {char name[20]; int dd,mm,yy; char addr[]; };

    char *F2(char *p, char *nm, char *ad)

    .... man1 *q =(man1*)p;

    strcpy(q->name,nm);

    strcpy(q->addr,ad);

    for (p=q->addr; *p!=0; p++);

    p++; return p;}








    struct list .... void *data; list *next; };

    void *F( list *p[], int (*pf)(void* ,void*))

    .... list *q ; void *pmin=p[0]->data;

    for ( int i=0; p[i] != NULL; i++)

    for (q = p[i]; q != NULL; q = q->next)

    if ((*pf)(q->data ,pmin) < 0) pmin=q->data;

    return pmin; }


    . . list , . list, . , , .

    void* . , , , . , . , , . , " " , .


    list a1={"this",NULL}, a2={"is",&a1}, a3={"the",&a2};

    list b1={"array",NULL}, b2={"of lists",&b1}, b3={"of strings",&b2};

    list *pp[]={&a3,&b3,NULL};


    . , , 2 , . , . void* , , " , " , char*.


    int cmp(void *p1,void *p2)....

    return strlen((char*)p1) - strlen((char*)p2); }




    , . , , void* char*, - , " " , , " " , .


    void main().... puts((char*)F(pp,cmp)); }




    , . . , , , .




    //-------------------------------------------------------- 1

    struct x1 .... void *data; x1 *next; };

    void F1( x1 **p, void (*pf)(void*))

    .... x1 *q;

    for (; *p != NULL; p++)

    for (q = *p; q != NULL; q = q->next)

    (*pf)(q->data);}

    //-------------------------------------------------------- 2

    struct x2 .... void *data; x2 *next; };

    struct sxxx .... x2 *ph; sxxx *next; };

    void F2( sxxx *p, void (*pf)(void*)) ....

    x2 *q;

    for (; p != NULL; p = p->next)

    for ( q = p->ph; q!=NULL; q=q->next)

    (*pf)(q->data); }





    )))



    )))

  2. #2
    Vadya       Vadya
    27.02.2007
    164
    ()
    0
    : 0 (: 0).

  3. #3
    G007       G007
    24.08.2007
    1,192
    ()
    0
    : 0 (: 0).


  4. #4
    Vadya       Vadya
    27.02.2007
    164
    ()
    0
    : 0 (: 0).

    ?

  5. #5
    Arkan       Arkan
    13.10.2006
    bezopasnik.org
    3,112
    ()
    0
    : 0 (: 0).

    ???
    ...

  6. #6
    TeRRaN_kuka       TeRRaN_kuka
    09.09.2007
    !?
    494
    ()
    0
    : 0 (: 0).

    G007
    struct list .... int val; list *next,*pred; };
    . -( ). int....

    G007
    int F1(list *p)

    .... int n;

    for (n=0; p!=NULL; p=p->next, n++);

    return n; }
    .

    G007
    list *F2(list *ph, int v)

    .... list *q = new list;

    q->val = v; q->next = ph; ph = q;

    return ph; }
    int v...

    ... ...
    * ?
    ... Veni.Vidi.Vici.
    510

  7. #7
    colombo       colombo
    08.03.2007
    , . -
    113
    ()
    0
    : 0 (: 0).

    ++

    long F1(int n)

    .... if (n==1) return 1;

    return (n * F1(n-1)); }
    n

    double F2(double *pk, double x, int n)

    ....

    if (n==0) return(*pk);

    return *pk + x *F2(pk+1,x,n-1);

    }

    void z3()

    .... double B[] ={ 5.,0.7,4.,3. } ,X=3., Y;

    Y = F2(B,X,4); }
    , :
    5 + 3 * (0.7 + 3 * (4 + 3 * 3))


    - , , ..

    , .. ?
    struct x1 .... void *data; x1 *next; };

    void F1( x1 **p, void (*pf)(void*))

    .... x1 *q;

    for (; *p != NULL; p++)

    for (q = *p; q != NULL; q = q->next)

    (*pf)(q->data);}
    pf (*p)->data **p
    colombo; 03.10.2007 01:12.

  8. #8
    JudgeS    JudgeS
    25.10.2006
    Nsk-(-)
    260
    ()
    0
    : 0 (: 0).

    - )) ))
    ,
    ...

  9. #9
    ant_katcin       ant_katcin
    01.03.2007
    484
    ()
    0
    : 0 (: 0).

    !
    ... . ...


  10. #10
    Sergio_NSK       Sergio_NSK
    22.06.2008
    6
    ()
    0
    : 0 (: 0).

    . (). , ... ...