编辑代码

#include <iostream>
using namespace std;
int main() {
    int a,b,c,d,e,f,g,x,y;
    cin >> a;
    b = a % 10;
    c = a / 10 % 10;
    d = a / 100 % 10;
    e = a / 1000 % 10;
    f = a / 10000 % 10;
    g = a / 100000 % 10;
    x = a / 1000000 % 10;
    y = b+c+d+e+f+g+x;
    cout<< y <<endl;
	return 0;
}
//2016 12 20 18 20 36