Home > Back-end >  Note to rise only this, a simple don't know what wrong operation not to come out
Note to rise only this, a simple don't know what wrong operation not to come out

Time:09-16

Check the running results that last printf many sides, don't know why just don't appear, also don't know what is problem

CodePudding user response:

Printf on the outside of the switch

CodePudding user response:

'return 0' behind the '} 'to go on the front of printf

CodePudding user response:

Enter 2018 9 don't add a comma

The switch (month)
{
.
}

The printf ();
return 0;

CodePudding user response:

Error:
1. Return 0; Statements in the main () function at the end, do not put in the switch () {} statement;
2. Case 2: statement of the if part, the brackets should not take ""; Correctly spelled the if (year % 4==0 | | year %==0 400) {}

Specification:
Case 2: add break statement;
2. The switch () {} statement increase the default branch;
3. Print statements (printf ()) on the switch () {} outside is better;

CodePudding user response:

D behind the percent
 printf (" % d on % d % d ", year, month, day); 

For the printf () function of the usage, please refer to the "c + + printf () function USES 10 to 1"
  • Related