首页 > 试题广场 >

#include #include &l...

[填空题]
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
    string st;
    int i, len;
    getline(cin, st);
    len = st.size(.);
    for (i = 0; i < len; i++){
        if (st[i] >= 'a' && st[i] <= 'z')
            st[i] = st[i] - 'a' + 'A';
    }
    cout << st << endl;
    return 0;
}
输入:Hello, my name is Lostmonkey.
输出:1

HELLO,WHERE IS YOURF 空格???
发表于 2020-09-13 20:02:17 回复(6)