酷代码 AI
菜单
服务商

C++字符类型判断:从键盘读取并分类输出

```cpp #include <iostream> using namespace std; int main() { char c; cin >> c; // 👇 判断字符类型 if (c >= 'A' && c <= 'Z') { cout << "upper" << endl; } else if (c >= 'a' && c <= 'z') { cout << "lower" << endl; } else if (c >= '0' && c <= '9') { cout << "digit" << endl; } return 0; } ``` ######[AI问答 | 137点数解答 | 2026-05-22 21:33:14]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]