文章

113

粉丝

1

获赞

869

访问

39.1k

头像
反序数 题解:c++
P1454 清华大学机试题
发布于2026年3月18日 21:11
阅读数 208

#include <iostream>
#include <map>
#include <string>
#include <algorithm>
using namespace std;

int main(){
    for(int i = 1000; i < 1112; i++){
        int num = i * 9;
        string s = to_string(i);
        reverse(s.begin(),s.end());
        int temp = stoi(s);
            if(temp == num){
                cout << i << endl;
        }
    }
    return 0;
}

 

 

 

 

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发