莉露C++编写题解 2846: 统计数字字符个数 解题思路:getline原句,for挨个判断,sizeof(s)=strlen(s)+1,但C++不可用strlen。注意事项:if(s[i]>=48&&s[i]<=57)可写作if(s[i]>='0'&&s[i]<='9')sizeof(s)-1可写作s.size() 题解列表 2026年02月27日 0 点赞 0 评论 268 浏览 评分:0.0
编写题解 2846: 统计数字字符个数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e7;ch…… 题解列表 2024年07月22日 0 点赞 0 评论 1180 浏览 评分:9.9
2846: 统计数字字符个数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e7;ch…… 题解列表 2024年07月18日 0 点赞 0 评论 831 浏览 评分:0.0
2846: 统计数字字符个数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;int main(){ string s…… 题解列表 2024年07月13日 0 点赞 0 评论 586 浏览 评分:0.0
2846: 统计数字字符个数 ```cpp#includeusingnamespacestd;typedeflonglongll;constintN=1e5;chara[N];intmain(){llsum=0;cin.getline(a,225);for(inti=0;i='0'&&a[i] 题解列表 2024年07月12日 0 点赞 0 评论 531 浏览 评分:0.0
2846: 统计数字字符个数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;const int N=1e5;char a[N];int main(){ …… 题解列表 2024年07月11日 0 点赞 0 评论 594 浏览 评分:0.0
解 2846: 统计数字字符 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;char a[1005];int main(){ int sum=0; cin.g…… 题解列表 2024年07月11日 0 点赞 0 评论 533 浏览 评分:0.0
比较常规的解题思路,挺清晰的 摘要:解题思路:注意事项:字符串中会有空格出现,用getline整行读取。参考代码:#includeusing namespace std; int main() { string s; …… 题解列表 2023年12月31日 0 点赞 0 评论 787 浏览 评分:9.9
2846: 统计数字字符个数 ```#includeusingnamespacestd;intmain(){intcnt=0;strings;getline(cin,s);for(inti=0;i='0'&&s[i] 题解列表 2023年12月19日 0 点赞 0 评论 412 浏览 评分:0.0
2846: 统计数字字符个数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=300;int main(){ int sum=0; str…… 题解列表 2023年12月19日 0 点赞 0 评论 381 浏览 评分:0.0