//the number and the minimum temperature below zero days accounted for the percentage of the total number of days,
#include
#include
360//# define qw1 cut-off rate of 1
468//# define qw2 cut-off rate of 2
720//# define qw3 cut-off rate of 3
0.1323////# define f1 was first used 360 KWH rate
# define f2/0.1504/then use 108 KWH rate
# define f3/0.30025/then use 252 KWH rate
# define the f4 0.3425//the use of more than 720 KWH rate
//use the cost of 360
* 360 # define qfei (f1)
//use the cost of 468
# define qfei1 (qfei + f2 * (qw2 - qw1))
//use the cost of 720
# define qfei2 (qfei + qfei1 + f3 * (qw3 - qw2)
Int main (void)
{
Double qianwan;
Double fy;
Printf (" please enter how many kw use ");
Lf the scanf (" % ", & amp; Qianwan);
If (qianwan<=qw1)
{
Fy=qianwan * f1;//the cost of less than or equal to 360 kw
}
Else if (qianwan>=qw1 & amp; & Qianwan<=qw2)
{
Fy=qfei + f2 (qianwan - qw1) *;//the cost of less than or equal to 420 kw
}
Else if (qianwan>=qw2 & amp; & Qianwan<=qw3)
{
Fy=qfei1 + f3 (qianwan - qw2) *;//cost of less than or equal to 720
}
The else
{
Fy=qfei2 + ((qianwan - qw3) * f4);//cost of more than 720
}
Printf (" always use % % is the total cost of lf. The 2 f ", qianwan, fy);//total cost
return 0;
}
[color=# 800000] machine error A.C PP (38) : error C2143: syntax error: missing ') 'before'; '
Why fy=qfei2 + ((qianwan - qw3) * f4);//to want to add this line more than 720 charges)
Correct code fy=qfei2 + (f4 (qianwan - qw3) *)) with brackets to run!
I feel so much more added a bracket is not? There are bosses know? [/color]
CodePudding user response:
Because your definition of preprocessing in a less)CodePudding user response:
CodePudding user response: