C++中如何判断输入的一个或两个字符是数字还是英文

要具体程序 呵呵 谢谢了

其实没有那么复杂了~在标准C里,有这么一些函数:
#include<stype.h>
int isdigit(int c);
int isalpha(int c);
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2016-09-23
#include <iostream>
using namespace std;

int main()
{
while(true)
{
char temp;
cin >> temp;
if ( (temp <= 'Z' && temp >= 'A') || (temp <= 'z' && temp >= 'a') )
cout << temp << " is character" << endl;
else if (temp >= '0' && temp <= '9')
cout << temp << " is number" << endl;
}
}本回答被提问者采纳