作业介绍

课程

天府路小学(东方校区)

#include <bits/stdc++.h>
using namespace std;

// get 作用:返回约数个数
? get(?) {

}

int main() {
    int n;
    cin >> n;
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        int num = get(i);
        if (num % 2 == 0) {
            cnt++;
        }
    }
    cout << cnt << endl;
}
#include <bits/stdc++.h>
using namespace std;

int get_max(int x) {
    // 1. 分别得到个位 十位 百位
    int a = x % 10, b = x / 10 % 10, c = x / 100;
    // 2. 进行三数排序
    int Max = max({a, b, c}); // 返回最大值
    int Min = min({a, b, c}); // 返回最小值
    int Mid = (a + b + c) - Max - Min; // 得到中间值
    // 3. 最大值放到百位,中间值放到十位,最小值放到个位
    // 4. 返回结果
    return Max * 100 + Mid * 10 + Min;
}

int get_min(int x) {
    // 1. 分别得到个位 十位 百位
    // 2. 进行三数排序
    // 3. 最小值放到百位,中间值放到十位,最大值放到个位
    // 4. 返回结果
}

int main() {
    int x;
    cin >> x;
    int cnt = 0;
    while (x != 495) {
        int t1 = get_max(x);
        int t2 = get_min(x);
        x = t1 - t2;
        cnt++;
    }
    cout << cnt << endl;
}
状态
已结束
题目
10
开始时间
2025-11-4 0:00
截止时间
2025-11-11 23:59
可延期
24 小时