fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. freopen("TONGCS.INP", "r", stdin);
  6. freopen("TONGCS.OUT", "w", stdout);
  7. string s;
  8. long long ans=0;
  9. cin>>s;
  10. for(int i=0;i<s.length();i++) ans+=s[i]-'0';
  11. cout<<ans;
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
Standard output is empty