Untitled

 avatar
user_5811307
plain_text
2 months ago
334 B
0
Indexable
Never
#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