[Plain] Description
X + y + z = n is given a positive integer. n is used to calculate the number of positive integer solutions that meet the conditions.
Input
Each group of input data has a positive integer n (n> = 3)
Output
Output result
Sample Input
3
4
5
Sample Output
1
3
6
Description
X + y + z = n is given a positive integer. n is used to calculate the number of positive integer solutions that meet the conditions.
Input
Each group of input data has a positive integer n (n> = 3)
Output
Output result
Sample Input
3
4
5
Sample Output
1
3
6
[Plain] # include <stdio. h>
Int main ()
{
Int m;
Int n;
Int;
Int B;
Int c;
While (scanf ("% d", & n )! = EOF & n> = 3)
{
M = 0;
For (a = 1; a <n; a ++)
{
For (B = 1; B <n-a; B ++)
{
C = n-a-B;
If (c> = 0)
{
M ++;
}
}
}
Printf ("% d \ n", m );
}
Return 0;
}
# Include <stdio. h>
Int main ()
{
Int m;
Int n;
Int;
Int B;
Int c;
While (scanf ("% d", & n )! = EOF & n> = 3)
{
M = 0;
For (a = 1; a <n; a ++)
{
For (B = 1; B <n-a; B ++)
{
C = n-a-B;
If (c> = 0)
{
M ++;
}
}
}
Printf ("% d \ n", m );
}
Return 0;
}