Home > Back-end >  Beginners small white, why else complains?
Beginners small white, why else complains?

Time:09-23

CodePudding user response:

Else if ();//found, in the if (,,,,,,,,) at the back of the semicolon

CodePudding user response:

Suggest use {} well, his look is convenient, also not easy to get wrong,

CodePudding user response:

reference 1/f, the truth is more important than right or wrong response:
else if ();//found, in the if (,,,,,,,,) at the back of the semicolon

Precisely in line 17,

CodePudding user response:

17 there should be a warning, pay attention to not only see the Error,

CodePudding user response:

Because line 17 the if () after a semicolon, leading to the last one else if there is no corresponding,
So the error said: the else if there is no obvious

CodePudding user response:

tiny ants reference 4 floor response:
17 line there should be a warning, pay attention to not only look at the Error,

If there is no the warning in an IDE
New people a lot of time in a hurry to see results, but I think it is better to take a closer look at the compiler output process, including warnings and errors in this case, if there is a problem easier to troubleshoot, actually short program also not many output,
Compiled code in the company now also often can see something like the No Return Value of warning, is really speechless,
But you ask me to ask what don't give him changed, who let me lazy?

CodePudding user response:

17 rows behind () more than a semicolon; This classification don't output different content can also use the switch () case statement;

CodePudding user response:

The
refer to the original poster qq_45867299 response:

Did you write less;

CodePudding user response:

Wrong, is more wrote;

CodePudding user response:

Elseif much a semicolon, semicolon would mean the end of the if statement

CodePudding user response:

You are to write a
; 
, python to write inside the
 : 

CodePudding user response:

Note the position of the semicolon

CodePudding user response:

How to write a semicolon

CodePudding user response:

Really? Small white, forgive me not honest smiled

CodePudding user response:

A if a semicolon after the below, words with a semicolon?

CodePudding user response:

refer to the sixth floor of tiny ants reply:
Quote: tiny ants reference 4 floor response:

17 there should be a warning, pay attention to not only see the Error,

If there is no the warning in an IDE
New people a lot of time in a hurry to see results, but I think it is better to take a closer look at the compiler output process, including warnings and errors in this case, if there is a problem easier to troubleshoot, actually short program also not many output,
Compiled code in the company now also often can see something like the No Return Value of warning, is really speechless,
But you ask me ask what changed, not to give him who makes me lazy,


After you are afraid of others see submit records under the illusion that you wrote

CodePudding user response:

Dear bosses, is the seventh row format is a little problem

CodePudding user response:

Line 7 double quotation marks, 17 the semicolon

CodePudding user response:

CodePudding user response:

Pay attention to the semicolon, if after a semicolon, write more

CodePudding user response:

Why do you want to omit {}?

CodePudding user response:

Line 7: should be the scanf (" % f ", & amp; Score);
Line 17: a semicolon

CodePudding user response:


Line 17 a semicolon!!!!!!
The compiler will think the semicolon is a statement, then the back of the printf is if the outside of the nested
Then the else behind, the compiler doesn't know what is the else if else, because has ended the if above, will be an error

CodePudding user response:

Brothers, wrong everyone find out for you,
Personal advice, you'll have to put your coding habits to cultivate it,
If or else no matter a few lines of code, had better add {}, this is advantageous to the code reading and later modified

CodePudding user response:

17 rows behind () more than a semicolon!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

In addition to the above bosses found the problem, I also found you input is wrong there



Should be written as
The scanf (" % f ", & amp; Score);

CodePudding user response:

Line 7 quotes should not take, & amp; Enclosed score, - from a pupil of grade five

CodePudding user response:

Line 7 and 17 line which made it very clear
  • Related