一日一プロ
SRM652 250
class ValueOfString { public int findValue(string s) { int moji = (int)'a'; int count = 0; int total = 0; for(int i=moji; i<(moji+26); i++){ string tmp = s; int i_tmp = 0; i_tmp = s.Length - tmp.Replace(((char)i).ToString(), "").Length; count += i_tmp; total += (((i-moji)+1) * count)*i_tmp; } return total; } }