acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 题解(函数+判断)

    #include <bits/stdc++.h> using namespace std; int countOnes(int n) { vector<int> nums; for (int i = 1; i <= n; ++i) { nums.push_back(i); } } int main() { int n; cin >> n; if(n<0){ n = abs(n); cout << countOnes(n); } else if(n==0){ cout<<0; } else{ } }

    userId_undefined

    Cristiano Ronald

    倔强青铜
    1阅读
    0回复
    1点赞
  • 题解

    userId_undefined

    zsy

    出道萌新7月全勤卷王时间刺客时空双修者题解仙人秩序白银
    6阅读
    0回复
    0点赞
  • 题解

    #include<bits/stdc++.h> using namespace std; int main(){ int a,sum=0,b; cin>>a; for(int i=1;i<=a;i++){ b=i; while(b!=0){ if(b%10==1){ sum++; } b/=10; } } cout<<sum; return 0; }

    userId_undefined

    LS_YZY

    题解仙人出道萌新时空双修者模拟·模拟练习生倔强青铜快乐小狗
    1阅读
    0回复
    0点赞
首页