Home > Software engineering >  Seek a great god advice, how to write code, let these formulas show>=50, <=1, and do not repea
Seek a great god advice, how to write code, let these formulas show>=50, <=1, and do not repea

Time:09-28

Seek a great god advice, how to write code, let these formulas show & gt;=50, & lt;=1, and do not repeat
I want to display the results effect is that the
If the formula addition & gt; 50 the number of, don't show, the largest 50
If the formula is presupposed & lt; 1 digital word, don't show, minimum 1
If the formula is presupposed=negative, and so does not display,
If the formula to calculate the results of the same, so, only show a good, don't repeat number, ask the great spirit show
N1 + 1
N4 interchange - 8
N3 + 8
N3-10
N1 + 16
N6-8
N4 interchange + 8
N4 interchange - 5
N2-8
N1-8
N4 interchange + 16
N4 interchange - 20
N1-1
N6 + 8
N2-1
N2-20
N1-32
N3-1
N6-1
N3-8
N1 + 3
N1-5
N2 + 8
N2 + 24
N1-3
N1-16
N1-20
N5 + 3
N3 + 24
N3-5
N2 + 5
N3 + 20
N5-20
N5 + 5
N4 interchange + 40
N6-5
N5 + 32
N4 interchange - 1
N6 + 40
N4 interchange - 32
N4 interchange + 3
N5 + 40
N2-24
N1-40
N6 + 5
N5-40
N4 interchange + 32
N4 interchange - 16
N3-3
N3 + 40
N1 + 5
N2 + 20
N6 + 10
N6 + 32
N2 + 32
N2 + 40
N6-40
N6-16
N5-32
N2 + 10
N5 + 8
N4 interchange + 24
N2 + 16
N2-40
N1-30
N5-3
N2-3
N1 + 20
N4 interchange - 10
N1-10
N5-5
N2-5
N5-30
N1 + 24
N3 + 30
N5 + 24
N6 + 20
N6 + 24
N6-30
N5 + 10
N1 + 8
N2-30
N4 interchange + 1
N6-20
N4 interchange - 40
N2-32
N3-30
N3 + 3
N1-24
N6-32
N3 + 16
N3 + 1
N2-16
N5 + 30
N3 + 32
N5-10
N5-24
N3 + 10
N5 + 20
N2-10
N1 + 10
N3-40
N4 interchange + 10
N4 interchange + 30
N3 + 5
N5-16
N6 + 1
N4 interchange + 5
N2 + 30
N4 interchange - 30
N5-8
N6-24
N3-32
N5 + 16
N3-20
N6 + 30
N4 interchange + 20
N5 + 1
N3-16
N1 + 30
N4 interchange - 3
N6-10
N4 interchange - 24
N2 + 3
N6 + 16
N2 + 1
N3-24
N6 + 3
N5-1
N1 + 32
N6-3
N1 + 40

CodePudding user response:

Which is a variable and state variable conditions is what kind of

CodePudding user response:

You said "if formula addition & gt; The number of 50, the don't show, the largest 50 ", "this does not show" what meaning be?
Refers to the value of discarded results than 50?
Or the "result if more than 50, it is equal to 50"?

CodePudding user response:

Said the shady,
You posted first put their own code, indicate where can't write, what goals to achieve,

CodePudding user response:

Several column, A column formula, B column calculated the value of the column C according to your request the value of the converted
C column and then take the only value,

CodePudding user response:

For reference only (albeit C) :
 # include & lt; Stdio. H> 
# include & lt; Stdlib. H>
# include & lt; Time. H>
Int d [6];
Int I, n, a, b, t;
C, int j;
Void main () {
Srand (time (NULL));
Printf (" shuffle 0.. N - 1 demo \ n ");
For (n=1; N<=5; N++) {/* (1 ~ 5 */
Printf (" _____n=% d_____ \ n ", n);
j=1;
For (c=1; C<=n; C + +) j=j * c;/* j for n! */
J *=n * 2;
For (c=1; C<=j; C + +) {/* test n * 2 * n! Time */
for (i=0; IFor (I=n; I> 0; I -) {/* disturb 0 ~ */n - 1
A=I - 1; B=rand () % I;
If (a! A=b) {t=d [a]; D [a] [b]=d; D [b]=t; }
}
Printf (" % 4 d: ", c);
for (i=0; Iprintf("\n");
}
}
Printf (" shuffle 1.. N demo \ n ");
For (n=1; N<=5; N++) {/* (1 ~ 5 */
Printf (" _____n=% d_____ \ n ", n);
j=1;
For (c=1; C<=n; C + +) j=j * c;/* j for n! */
J *=n * 2;
For (c=1; C<=j; C + +) {/* test n * 2 * n! Time */
for (i=1; I<=n; I++) d [I]=I;/* fill in 1 ~ n */
For (I=n; I> 1; I -) {/* disturb 1 ~ n */
a=i; B=rand () % I + 1;
If (a! A=b) {t=d [a]; D [a] [b]=d; D [b]=t; }
}
Printf (" % 4 d: ", c);
for (i=1; I<=n; I++) printf (" % d ", d [I]);
printf("\n");
}
}
}
  • Related