*你好!我正在制作程序,用户输入一个句子,程序打印出一个句子中有多少个字母(大写和非大写)。我做了一个程序,但它打印出奇怪的结果。请尽快提供帮助。:)
include <iostream>
include <string>
using namespace std;
int main()
{
string Sent;
cout << "Enter a sentence !"<<endl;
cin>>Sent;
for(int a=0;a<Sent.length();a++){
if (96<int(Sent[a])<123 || 64<int(Sent[a])<91){
cout << "this is letter"<< endl;
}else{
cout << "this is not letter"<< endl;
}
}
}