Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
44890 蒋金珂 质数的和与积 C++ Accepted 2 MS 272 KB 311 2023-03-03 11:37:39

Tests(10/10):


Code:

#include<iostream> using namespace std; int a(int i) { for(int t=2; t*t<=i; t++) { if(i%t==0) { return 0; } } return 1; } int main() { int s,max=0; cin>>s; for(int i=2; i+i<=s; i++) { if(a(i)&&a(s-i)) if(max<i*(s-i)) { max=i*(s-i); } } cout<<max; return 0; }