1 solutions

  • 0
    @ 2026-11-15 12:38:05

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    bool judge(int x) {
        while (x > 0) {
            if (x % 10 == 7) {
                return true;
            }
            x /= 10;
        }
        return false;
    }
    int main() {
        int L, R, cnt = 0;
        scanf("%d%d", &L, &R);
        for (int i = L; i <= R; i++) {
            if (judge(i)) {
                printf("%d\n", i);
                cnt++;
            }
        }
        if (cnt == 0) {
            printf("None\n");
        }
        return 0;
    }
    
    • 1

    Information

    ID
    185
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By