Results 1 to 5 of 5

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Mar:2018
    Location: pleven
    Posts: 6

    . , , . C++ . . .. , , . : N- . . .

  2. #2
    Registered User
    Join Date: Feb:2005
    Location: -
    Posts: 7,564
    !

    , , !

    !

    ? , !

    .

    !

  3. #3
    Registered User
    Join Date: Oct:2006
    Location: Plovdiv
    Posts: 895
    , . "".

  4. #4
    _ niksus's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 4,521
    .
    There are no choices. Nothing but a straight line. The illusion comes afterwards when you ask "Why me?" and "What if?".
    If you had done something differently, it would be someone else, looking back, asking a different set of questions.
    /Max Payne/

  5. #5
    Registered User odido's Avatar
    Join Date: Feb:2015
    Location: Bulgaria
    Posts: 529
    , ., .
    #include<iostream>
    #include<stdlib.h>

    #define M 100

    typedef float ElementType;

    struct Queue
    {
    int r, f;
    ElementType QueueArray[M];
    };

    void pushq(struct Queue *q, ElementType x)
    {
    if((q->r + 1) % M == q->f)
    {
    printf ("! ");
    exit(1);
    }
    q->r = (q->r + 1) % M;
    q->QueueArray[q->r] = x;
    }
    ElementType popq(struct Queue *q)
    {
    if(q->r == q->f)
    {
    printf(" ! ");
    exit(1);
    }
    q->f = (q->f + 1) % M;
    return q->QueueArray[q->f];
    }

    void main()
    {
    struct Queue mem = {0, 0}; //
    ElementType y = 3.14f;


    int i;
    for(i = 1; i <= 99; i++)
    pushq(&mem, y+=1.1f);

    for(i = 1; i <= 99; i++)
    printf("%.2f ", popq(&mem));
    }
    Last edited by odido; 22nd March 2018 at 03:11.
    Lenovo R61i/8GB DDR2 800/T7700 2.4Ghz /Adata SSD 240GB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |