1 solutions

  • 0
    @ 2025-11-29 12:35:42

    C :

    #include "stdio.h"
    #include "math.h"
    int main() {
        int x;
        printf("Input x:\n");
        scanf("%d", &x);
        x = fabs(x);
        int a, b, c;
        // 取下个位数
        a = x % 10;
        x = x / 10;
        
        // 取下十位数
        b = x % 10;
        x = x / 10;
        
        // 取百位数
        c = x;
        printf("y=%d\n", a * 100 + b * 10 + c);
        return 0;
    }
    
    • 1

    Information

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