Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
98400 万隽宇 质数的和与积 C++ Accepted 6 MS 272 KB 570 2024-11-21 19:05:04

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; bool a(int x){ for(int j=2;j<=x/2;j++){ if(x%j==0){ return false; } } return true; } int main(){ int s,b=0; cin>>s; for(int i=2;i<=s/2;i++){ if(a(i)&&a(s-i)){ if(b<i*(s-i)) b=i*(s-i); } } cout<<b; return 0; }