Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <cstdio>#include <iostream>#include <string>using namespace std;int main(){string s;while (getline(cin, s)) {string ori, word;bool sentBegin = true;for (auto i : s) {if (i >= 'A' && i <= 'Z') {i = i - 'A' + 'a';}if (i >= 'a' && i <= 'z') {if (sentBegin && word.empty()) {i = i - 'a' + 'A';}word += i;}else {if (!word.empty()) {if (sentBegin) {if (!ori.empty()) {ori += ' ';}ori += word;sentBegin = false;}