我正在创建一个程序来查找使用和充电的个人和总千瓦时,以及客户总数。我收到的错误消息是undefined reference to "If"
什么Id returned 1 exit status
原因造成的?
/* program to determine cost for a certain number of kilowatt hours */
#include <stdio.h> /* printf, scanf definitions */
#include <math.h>
double charges_to_return(int kwh_f);
int main (void)
{
int cust_number;
int kwh;
int total_cust;
int total_kwh;
double total_charge;
double cust_charge;
double charge;
total_cust = 0;
total_kwh = 0;
total_charge = 0;
cust_number = 0;
while (cust_number != -1)
{
printf("Enter customer number and kwh (-1 to quit): ");
scanf("%d %d", &cust_number, &kwh);
If (cust_number != -1);
{
total_cust++;
total_kwh = total_kwh + kwh;
cust_charge = charges_to_return(kwh);
total_charge = total_charge + cust_charge;
printf("Customer Num: %d KWH used: %d Charge: %.2lf", cust_number, kwh, cust_charge);
}
}
printf("Total Customers: %d Total KWH used: %d Total Charges: %.2f", total_cust, total_kwh, total_charge);
return (0);
}