Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
7178 李成蹊 数1的个数 C++ 通过 0 MS 248 KB 253 2023-02-01 14:47:04

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int R; cin>>R; int total=0; for(int i=1;i<=R;i++){ int x=i; while(x>0){ int g=x%10; x=x/10; if(g==1){ total+=1; } } } cout<<total; return 0; }


测评信息: