Home > Back-end >  What is this?
What is this?

Time:09-27

# include & lt; stdio.h>
Maximum int grading (int, int, int pass variables)//custom grading function, can be incremented, can decline.
{
Int return value;
If (starting & lt; Ceiling)
{
for(; Starting & lt;=limit; Starting=start + recursion variables)
{
Return value=return value + start;

Printf (" % d ", the return value);
Printf (" % d \ n ", starting);

//getchar ();
}
}
Else if (starting & gt; Ceiling)
{
for(; Starting & gt;=limit; Starting=start - pass variables)
{
Return value=return value - starting;

Printf (" % d ", the return value);
Printf (" % d \ n ", starting);

//getchar ();
}
}
Else if (==initial cap)
{
Return value=0;
}

The return value returned;
}

Void main ()
{
Int starting=100, ceiling=1, pass the variable=1;
Int result=grading (starting, ceiling, pass variables);

Printf (" % d \ n ", result);
}

CodePudding user response:

Looks like the program, but not the variable name is in Chinese, the compiler does not support,

CodePudding user response:

Compiler support variable in Chinese now?
Anyway, I am used Chinese variable names, didn't try,,

CodePudding user response:

This is what the compiler, can support the identifier in Chinese?
This program is a may, according to "start" and "limit" the value of the judgment is a program in increasing circulation or decreasing cycle, can be used as a practice exercises of the cycle of C language code,
For you to reformat and easy to understand:
 # include & lt; stdio.h> 
Maximum int grading (int, int, int pass variables)//custom grading function, can be incremented, can decline.
{
Int return value;
If (starting & lt; Ceiling)
{
for (; Starting & lt;=limit; Starting=start + recursion variables)
{
Return value=return value + start;

Printf (" % d ", the return value);
Printf (" % d \ n ", starting);

//getchar ();
}
}
Else if (starting & gt; Ceiling)
{
for (; Starting & gt;=limit; Starting=start - pass variables)
{
Return value=return value - starting;

Printf (" % d ", the return value);
Printf (" % d \ n ", starting);

//getchar ();
}
}
Else if (==initial cap)
{
Return value=0;
}

The return value returned;
}

Void main ()
{
Int starting=100, ceiling=1, pass the variable=1;
Int result=grading (starting, ceiling, pass variables);

Printf (" % d \ n ", result);
}

CodePudding user response:

Basic equivalent To VB For I=a To b Step c (the main function, the limit is lower than the lower limit For I=100 To 1 Step 1)
In 100 to 1 in every 1 as an addend, added to the return value in the
The 100 + 99 + 98 +... + 1
The result is 5050
  • Related