3 solutions

  • 0
    @ 2024-9-22 14:24:03

    #include<stdio.h> int main(){ int a,i; scanf("%d",&a); for(i=3;i<=7;i+=2){ if(a%i==0)printf("%d ",i); } if(a%3!=0&&a%5!=0&&a%7!=0) printf("n"); return 0; }

    • 0
      @ 2024-9-22 14:23:40

      #include<stdio.h> int main(){ int a,i; scanf("%d",&a); for(i=3;i<=7;i+=2){ if(a%i==0)printf("%d ",i); } if(a%3!=0&&a%5!=0&&a%7!=0) printf("n"); return 0; }

      • 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;  
        }
        

        我这个又臭又长

        • 1

        Information

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