2016年蓝桥杯A组 填空题 1.网友年龄 题型:模拟题 一次过

46 阅读1分钟

1.网友年龄 - 蓝桥云课 (lanqiao.cn)

#include <bits/stdc++.h>
using namespace std;
int main()
{
    for (int i = 10; i < 100; i++)
    {
        string s = to_string(i);
        reverse(s.begin(), s.end());

        int temp = stoi(s);

        if (i - temp == 27)cout << i << endl;
    }
    return 0;
}