• CodeForces 688B Lovely Palindromes (水题回文)


    题意:给一个数n,让你找出长度为偶数,并且是第 n 个回文数。

    析:你多写几个就知道了,其实就是 n,然后再加上n的逆序,不过n有点大,直接用string 好了。

    代码如下:

    #include <iostream>
    #include <cmath>
    #include <cstdlib>
    #include <set>
    #include <cstdio>
    #include <cstring>
    #include <algorithm>
    #include <string>
    
    using namespace std;
    string s;
    
    int main(){
        cin >> s;
        cout << s;
        for(int i = s.size()-1; i >= 0; --i) cout << s[i];
        cout << endl;
        return 0;
    }
    
  • 相关阅读:
    javascript基础
    html基础
    css基础
    django-session和cookie
    rest架构
    django-models
    django-templates
    Alignment
    ural 1225.Flags
    ural 1009. K-based Numbers
  • 原文地址:https://www.cnblogs.com/dwtfukgv/p/5645480.html
Copyright © 2020-2023  润新知