请输入标题
2026-02-21 21:42:44
发布于:辽宁
1阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
//输入
string s;
cin >> s;
int cnt = 0;
//提取字符串中的'1'
for(int i=0; s[i]!='\0'; i++){
if(s[i] == '1')
cnt++;
}
//输出
cout << cnt;
return 0;
}
这里空空如也







有帮助,赞一个