D
davy.zou
then its an easy one,
x is the requested number
int sevens=x/7 //without the fractures
remainder=x - (sevens*7)
int twos= remainder/2 //without the fractures
if (remainder - (twos*2)) =1 then twos++
if sevens != 0 && sevens<twos then twos=twos-sevens, nines= sevens,
sevens=0
if twos != 0 && twos<sevens then sevens=sevens-twos, nines= twos, twos
=0
just put it in c code
1 1int sevens=x/7 //without the
fractures
2 remainder=x - (sevens*7)
3 int twos= remainder/2 //without the fractures
4 if (remainder - (twos*2)) =1 then twos++
5 if sevens != 0 && sevens<twos then twos=twos-sevens, nines= sevens,
sevens=0
6 if twos != 0 && twos<sevens then sevens=sevens-twos, nines= twos,
twos=0
I don't get it. Several things in fact.
First, I can't see what your program does. Since it doesn't have an
output statement. But I will go on a tangent and guess that it is for
comparing which ever way is the most effective way to distribute the
stamps.
Second, why not just use x%7 for line 2?
Third, since you assigned that twos be reminder/2, then the act of
mutiplying twos by 2 would result in the remainder from line2.
Therefore, in line4, having remainder-remainder would result in 0.
Fourth, in line4, what do you mean by twos++?
Five, line 5 and 6 doesn't make much sense either.
Six, what is if final out put?
I really appreciate you trying to help, and I know that with the above
list I sound like an ungrateful little brat. But I am grateful. I just
don't get your programing. Please explain.
Davy