NOIP2014 阅读程序
3.
#include <iostream> #include <string> using namespace std; int main() { 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.
输出:
发表评论