根据不同配置选择合适的数据类型,具体示例如下:
bool switchState = true;
int age = 30; float height = 1.8; double price = 9.99;
string username = "john"; string email = "john@example.com";
enum Month {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec}; Month month = Month::Jan;
double scores[] = {90.5, 80.0, 85.5};
根据具体需求选择合适的数据类型可以提高程序的效率和可读性。