Home > Back-end >  The title
The title

Time:10-10

Rookie help
Rule 198 by four positive integer addition, please calculate how many
Kind of additive package

CodePudding user response:

Simple and crude method is 3 a for loop, complex permutation and combination, recursive algorithm is not say,
Int I, j, k;
for(i=1; i<=198/4; I++) {
For (j=I + 1; j<=198/4; J++) {
For (k=j + 1; k<=198/4; K++) {
Printf (" 198=+ + + % d % d % d % d \ n ", I, j, k, 198 - (I + j + k));
}
}
}

CodePudding user response:


The method of enumeration, violence, for
  • Related