Home > Back-end >  Why couldn't changed my order
Why couldn't changed my order

Time:10-11

Just put a and b in the order of the once, and then not

CodePudding user response:

You are the second input comma is Chinese

CodePudding user response:

After the scanf, how are you getting along with a printf, take out a and b output and see if the two values you enter
To avoid this problem
The scanf (" % d % d ", & amp; A, & amp; b); Don't comma, middle input also 45, 12 Numbers separated by Spaces between

CodePudding user response:

You enter the second time, in addition, also added a space, is a problem, to enter and set the scanf format

CodePudding user response:

Upstairs said positive solution, add a space, actually didn't read to 45 this value, the equivalent of b is not the assignment, so a random number

CodePudding user response:

Hand space problem by mistake, in fact, if you have any questions for this case, you can try the Debug, I compiler is Dev - c + +, is to click on a "tick", to Debug, Visual should also do not have what difference

CodePudding user response:


Don't talk nonsense!
The scanf enter multiple Numbers, enter 12, then don't say a space between, you put 100 blank space don't affect or even knock on eight line enter input for another 45 also does not affect the right input
Spaces, tabs, and carriage returns will be the scanf automatically filter out

Int main () {
Int a, b, n.
N=the scanf (" % d, % d ", & amp; A, & amp; b);
N: printf (" % d, a: b: % d % d \ n ", n, a, b);//output at once you get to the value of a and b, and the scanf correct number from the keyboard to get effective worth n
,,,,,,

CodePudding user response:

Pay attention to the comma in English, type in Chinese comma, according to the characters of the comma usage (both in English and Chinese) so there will be a different ~ you say this problem
  • Related