判断输入的一个字符是否为大写
判断输入的一个字符是否为大写 若是:转化成小写 若不是:原样输出
#include <iostream>
using namespace std
;
int main()
{
char x
;
cout
<< "请输入需要判断的字符:" << endl
;
cin
>> x
;
(int)x
>= 65 && (int)x
<=96 ?
cout
<< "此字符为大写字母,转化成小写字母"<<char((int)x
+32)<< endl
:
cout
<< "此字符为小写字母" << x
<< endl
;
system("pause");
return 0;
}
转载自:黑凤梨の博客
转载请注明原文地址:https://blackberry.8miu.com/read-2349.html