蓝桥杯 1118: Tom数 Easy only once

基本思想:

无;

 

关键点:

无;

 

#include
#include
#include
#include 
#include<string>
#include
#include
#include
using namespace std;
using std::vector;
vector<int>vec;

int main() {
    string s;
    while (cin >> s) {
        int cnt = 0;
        for (int i = 0; i < s.size(); i++)
            cnt += s[i] - '0';
        vec.push_back(cnt);
    }
    for (auto ele : vec)
        cout << ele << endl;
    //system("pause");
    return 0;
}

 

你可能感兴趣的:(蓝桥杯 1118: Tom数 Easy only once)