题解 2829: 数1的个数

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

题解 2829: 数1的个数

摘要:解题思路:可以用while拆解个各位,比较通用,但是本题说明了是10000以内的数,就用了简单拆分注意事项:注意逻辑或||造成的短路问题,使用||时只要有一个条件满足就会count++,但是这个数会不……

2829:数1的个数

摘要:解题思路:注意事项:参考代码:int main(){ int num,count=0,i,n; scanf("%d",&……

2025/8/6刷题记录

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d&qu……

C题解 2829: 数1的个数

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ long long a,b=0; scanf("%……

2829: 数1的个数

摘要:解题思路:注意事项:致 别吃张博维giegie参考代码:#include <bits/stdc++.h>using namespace std;int main(){    long long n,s……

2829: 数1的个数

摘要:参考代码:arr = [str(i + 1) for i in range(int(input()))] print(&#39;&#39;.join(arr).count(&#39;1&#39;))……

编写题解 2829: 数1的个数

摘要:解题思路:注意事项:参考代码:n=int(input())times=0for i in range (1,n+1):    times+=str(i).count(&#39;1&#39;)print……