太简单了
2025-10-12 20:27:55
发布于:四川
1阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main() {
int n,cnt;
cin>>n;
for(int i = 1; i <= n; i++){
int x=i;
while(1){
if(x%10==1){
cnt++;
}
x/=10;
if(x == 0){
break;
}
}
}
cout << cnt;
return 0;
}
这里空空如也





有帮助,赞一个