已采纳 朱宗晔 初级光能 核心部分 for(int i = 1;i <= str.size();i++){ if(str[i] >= 'a' && str[i] <= 'z') a++; if(str[i] >= 'A' && str[i] <= 'Z') A++; }