题解 | #对称平方数#

对称平方数

https://www.nowcoder.com/practice/1b79865e2f534db0adba84dca10d6bae

#include <bits/stdc++.h>
#include <string>
using namespace std;
int main() {
    for(int i=1;i<=256;i++)
    {
        string str;
        str=to_string(i*i);
        string str1=str;
        reverse(str.begin(),str.end());
        if(str1==str) cout<<i<<endl;
    }

}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

评论
2
收藏
分享

创作者周榜

更多
正在热议
更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务