int battery_capacity;
int charge_timel;
int charge_voltage;
int charge_current;
``
```cpp
float BiZhong =(float)charge_voltage * (float)charge_current* (float)charge_timel / (float)battery_capacity*100;
如代码,每个都要进行类型转换,否则结果就是0;
int battery_capacity;
int charge_timel;
int charge_voltage;
int charge_current;
``
```cpp
float BiZhong =(float)charge_voltage * (float)charge_current* (float)charge_timel / (float)battery_capacity*100;
如代码,每个都要进行类型转换,否则结果就是0;