Results 1 to 5 of 5
Hybrid View
-
21st March 2018 16:16 #1Registered User
Join Date: Mar:2018
Location: pleven
Posts: 6
. , , . C++ . . .. , , . : N- . . .
-
21st March 2018 17:11 #2Registered User
Join Date: Feb:2005
Location: -
Posts: 7,564
!
, , !
!
? , !
.
!
-
21st March 2018 17:18 #3Registered User
Join Date: Oct:2006
Location: Plovdiv
Posts: 895
,
. "".
-
21st March 2018 18:14 #4
.
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/
-
22nd March 2018 02:26 #5
, ., .
#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




Reply With Quote
7th May 2023, 16:02 in PC