1 solutions

  • 0
    @ 2024-10-16 23:18:35

    #include <stdio.h> int isprime(int a) { int k; int ret=1; for(k=2;k<a-1;k++){ if(a%k==0){ ret=0; break; } } return ret; } int main() { int S,i,m; int max=1; scanf("%d",&S); for(i=S/2;i>0;i--){ m=S-i; if(isprime(i)&&isprime(m)){ if(mi>=max){ max=mi; } } } printf("%d",max); return 0; }

    • 1

    Information

    ID
    6801
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    4
    Tags
    (None)
    # Submissions
    51
    Accepted
    25
    Uploaded By