标签:class blog code string os name
水题
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector<int> a(4); cin >> a[0] >> a[1]>>a[2]>>a[3]; string str; cin >> str; int res = 0; for(int i = 0 ; i < str.length(); ++ i) res+=a[str[i]-‘0‘-1]; cout<<res<<endl; }
Codeforces Round #249 (Div. 2) A. Black Square,布布扣,bubuko.com
Codeforces Round #249 (Div. 2) A. Black Square
标签:class blog code string os name
原文地址:http://www.cnblogs.com/xiongqiangcs/p/3786254.html