标签:
题目翻译完了是每一位之和是多少。
#pragma comment(lnker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #include<stack> #include<iostream> using namespace std; typedef long long LL; const double pi=acos(-1.0); void File() { freopen("D:\\in.txt","r",stdin); freopen("D:\\out.txt","w",stdout); } char s[100000]; int main() { while(~scanf("%s",s)) { int sum=0; for(int i=0;s[i];i++) { if(s[i]==‘-‘) continue; sum=sum+s[i]-‘0‘; } printf("%d\n",sum); } return 0; }
标签:
原文地址:http://www.cnblogs.com/zufezzt/p/5782050.html