hdoj 2573

来源:互联网 发布:多点触摸软件 编辑:程序博客网 时间:2024/06/18 10:17

http://acm.hdu.edu.cn/showproblem.php?pid=2573

//字符串#include <iostream>#include <string>using namespace std;int main(){ int t, k; bool Caps; string str, res; cin >> t; while (t--) {  cin >> k;  Caps = false;  res.clear();  while (k--) {   cin >> str;   if (str == "Caps") Caps = !Caps;   if (str.find("Shift") != string::npos) {    cin >> str;    Caps = !Caps;    if (Caps == false) res+=(tolower(str[0]));    else res+=(toupper(str[0]));    Caps = !Caps;    continue;   }   if (str.length() == 1) {    if (Caps == false) res+=(tolower(str[0]));    else res+=(toupper(str[0]));   }  }  cout << res << endl; } return 0;}


 

原创粉丝点击