OJ上的问题运行错误不知道怎么搞

Sum of Numbers
自己感觉到代码没什么问题

img

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s;
    for (int i = 0; i >= 0; i++)
    {
        getline (cin , s);
        int a = s.length();
        int b = s.at(0);
        
        if (a==1&&b==0)
        break;
        
        else 
        {
            int c = 0;
            for (int j=0; j < a;j++)
            {
                c = 0 ;
                c = c + s.at(j); 
            }
            
            cout << c <<endl;
        }
    }
    return 0;
}

21行的c=0要去掉,每次加了一位数字后c又被变为0了

觉得有用的话采纳一下答案哈