我想将输入从大写更改为小写,例如。如果输入是R,它将变为r。我希望它与字符串不是字符。我试过这个从大写更改为小写C++
one=tolower(one);
two=tolower(two);
但它没有工作。
#include <cctype>
#include <iostream>
using namespace std;
int main() {
string one;
string two;
cout << "\nPlayer One, please enter your move: ('p' for Paper, 'r' for Rock, '$
cin >> one;
cout <<"\nPlayer Two, please enter your move: ('P' for Paper, 'R' for Rock, 'S'$
cin >> two;
是的,我需要输入lowerc ase,以防万一,如果用户把大写 – user3378134