0
x=0;
t=0;

 int t2=0,t3;
 while(t<=ref)
  {t3=t2;

   for(x=0;x<jbn;x++)
	{ if(t==cpy2[x].at)
	    {
	       if(q>=cpy2[x].bt)
		      {
		      t2+=cpy2[x].bt;
		      tt[x++]=t2;
		      cpy2[x].bt=0;
		      qq++;
		      }
	       else if(q<cpy2[x].bt)
		       {
		       t2+=q;
		       cpy2[x].bt-=q;
		       cpy2[x].at=t2;
		       qq++;
		       }
	     }
	    else
	    break;
	    }


   t++;
   if(t3==t2)
	{t2++;}
   };

assuming the values are
cpy2[0].at==1
cpy2[0].bt==2
cpy2[1].at==2
cpy2[1].bt==3
cpy2[2].at==4
cpy2[2].bt==4
q==2
qq is just an add on
jbn==3
and
ref==10

the results are tt[]={3,5,9}

but we want tt[]={3,8,10}

can you help?

p.s.
dont suggest to initialize tt[] by that.... we need process!!

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by WaltP
0

>>>can you help?
No -- I have no clue what that program is supposed to do. Don't expect me to read your other threads -- a thread should stand on its own.

0

And posts should NEVER be marked urgent! It's not urgent to us -- we'll get to it when we get to it. And many people simply bypass threads titled like this so you've just cut down your chances for help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.