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

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 利用python的切片解决

    s = int(input()) for i in range(1,s+1): st = str(i) if st==st[::-1]: print(st)

    userId_undefined

    一只小羊

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

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

    userId_undefined

    菜

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

    userId_undefined

    majmDZB

    倔强青铜
    0阅读
    0回复
    0点赞
  • AC

    #include<bits/stdc++.h> using namespace std; bool func(int x){ string s = to_string(x); string rev_s = s; reverse(s.begin(),s.end()); return rev_s == s; } int main(){ int n; cin >> n; for(int i = 1;i <= n;i++){ if(func(i))cout << i << endl; } return 0; }

    userId_undefined

    dfs却一场空

    倔强青铜
    0阅读
    0回复
    0点赞

共44条

  • 1
  • 2
  • 3
20条/页
跳至页
首页