提交时间:2025-07-11 16:39:14

运行 ID: 331196

#include <bits/stdc++.h> using namespace std; string s; long long b=0; int main() { getline(cin,s); int l=s.size(); int a=s[l-1]-'0'; while(l>0) { int x=a%10; int y=a/10; b+=x; l--; } cout << b; return 0; }