标签:
手速题
#include <bits/stdc++.h> using namespace std; #define For(i,n) for(int i=1;i<=n;i++) #define Rep(i,n) for(int i=0;i<n ;i++) #define MAXN (100000) string s; int main() { //freopen("1.in.cpp","r",stdin); bool t=true; while (getline(cin,s)) { int l=s.length(); for (int i=0;i<l;i++) { if (t) { if (!isalpha(s[i]) && !(s[i]<='9' && s[i]>='0')) {printf("%c",s[i]);continue; } if (s[i]<='9' && s[i]>='0') {t=false;printf("%c",s[i]);continue; } s[i]=toupper(s[i]); printf("%c",s[i]); t=false; continue; } if (!t) { if (s[i]=='.') { printf("%c",s[i]);t=true; } else printf("%c",tolower(s[i])); } } cout<<endl; } return 0; }
标签:
原文地址:http://blog.csdn.net/nike0good/article/details/45190059