Home > Back-end >  Please answer
Please answer

Time:11-30

#include
Int main ()
{
Int a, b, c, Max, temp.
Scanf_s (" % d, % d, % d ", & amp; A, & amp; B, & amp; C);
Temp=(a & gt; B)? A: b;
Max=(temp & gt; C)? Temp: c;
Printf (" Max=% d ", Max).
return 0;
}
This is what above VS2019 execution when the result is I the first input value

CodePudding user response:

How do you input data, input format right?
Input: 1, 2, 3 a carriage return (comma is a comma in English)

CodePudding user response:

The scanf comma-delimited inside, when the input has to have a comma, Suggestions (" % d % d % d ") in this way, the input, separated by Spaces

CodePudding user response:

In the right format input, the scanf is a comma in English, I also input window in the implementation of the comma in English, no matter what type, Max is only the first number,
But if the scanf for Chinese comma, in the execution of box input format is also there will be no problem, in Chinese (" % d % d % d "), separated by Spaces when input there will be no problem, it is only in the scanf for a comma in English, even if the executive box input format is correct, will go wrong,
  • Related