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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情提交记录(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月全勤卷王8月全勤卷王时空双修者题解仙人快乐小狗秩序白银
    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点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页