18 条题解

  • -3
    @ 2021-12-4 12:42:50

    各位的题解都这么复杂? 最简题解(目前):

    #include <stdio.h>
    int main() {
        int n;
        scanf("%d", &n);
        bool a = false;
    
        if (n % 3 == 0) {
            printf("%d ", 3);
            a = true;
        }
    
        if (n % 5 == 0) {
            printf("%d ", 5);
            a = true;
        }
    
        if (n % 7 == 0) {
            printf("%d ", 7);
            a = true;
        }
    
        if (!a)
            printf("n");
    
    }
    

    其中的a用于判断是否无法被任何数输出。

    信息

    ID
    864
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    1118
    已通过
    342
    上传者