60pts,求调
查看原帖
60pts,求调
1101517
Clang_239楼主2024/12/5 21:16
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n,x,t;
string b;
signed main(){
	cin>>n>>x;
	for (LL i=1;i<n+1;i++){
		b = to_string(i);
		for (LL j=0;j<b.size();j++){
			if (b[j]=='1') t+=1;
		}
		b="";
	}
	cout<<t;
	return 0;
}
2024/12/5 21:16
加载中...