http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0020&lang=jp
#include <iostream> #include <string> using namespace std; int main (int argc, const char * argv[]) { string read; while (getline(cin,read)) { // - 32 for (int i=0; i < read.size(); i++) { if(read[i] != ' ' && read[i] != '.') { read[i] = read[i] - 32; } } cout << read << "\n"; } return 0; }