【算法题】CCF CSP第三题练习
样例全部没问题,但是只有40分,不知道哪里出问题了: #include <iostream> #include <string> #include <map> #include <sstream> using namespace std; class Fomular { private: string s, sr, sp; map<string,int> reactant; map<string,int> product; map<string,int> rElement; map<string,int> pElement; bool isLowercase(char a) { if (a >= 'a' && a <= 'z') return true; return false; } bool isUppercase(char a) { if (a >= 'A' && a <= 'Z') return true; return false; } bool isDigit(char a) { if (a >= '0' && a <= '9') return true; return false; } void split(string s, decltype(product) &m) { int a{0}, b{0}, i, j, tt; string t; for (i = 0;