Untitled

 avatar
user_5811307
plain_text
a year ago
334 B
0
Indexable
#include <iostream>
#include <cmath>
#include <string>
#include <vector>

using namespace std;

int sum(string g)
{
    int gg = 0;
    for(int i=0; i < g.length();i++)
    {
        if(g[i] == '1')
        {
           gg++;
        }
    }
    return gg;
}



int main()
{
    string name;
    cin >>name;
    cout <<sum(name);


}
Leave a Comment