3 solutions

  • 0
    @ 2023-9-30 14:06:53
    #include <stdio.h>  
      
    int main() {  
        int num;  
        scanf("%d", &num);  
      
        if (num % 3 == 0 && num % 5 == 0 && num % 7 == 0) {  
            printf("3 5 7 ");  
        } else if (num % 3 == 0 && num % 5 == 0) {  
            printf("3 5 ");  
        } else if (num % 3 == 0 && num % 7 == 0) {  
            printf("3 7 ");  
        } else if (num % 5 == 0 && num % 7 == 0) {  
            printf("5 7 ");  
        } else if (num % 3 == 0) {  
            printf("3 ");  
        } else if (num % 5 == 0) {  
            printf("5 ");  
        } else if (num % 7 == 0) {  
            printf("7 ");  
        } else {  
            printf("n ");  
        }  
      
        return 0;  
    }
    

    我这个又臭又长

    Information

    ID
    6742
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    6
    Tags
    (None)
    # Submissions
    284
    Accepted
    87
    Uploaded By