0_0_13813843_19549.cpp:1:429: fatal error: GCC4.9.2/lib/gcc/x86_64-w64-mingw32/4.9.2/include/iostream>usin: Invalid argument
#include<iostream>using namespace std;int prime(int x){ int i; for(i=x/2+1;i>1;i--) if(x%i==0)return 0; return 1;}int main(){ int n,i,j,c; while(cin>>n&&n) { c=0; for(i=2;i<n/2;i++) { if(prime(i)) for(j=n;j>n/2;j--) if(prime(j)&&i+j==n)c++; } cout<<c<<endl; } system("pause"); return 0;}结果超时,求高手给高效方法,只要有思想即可。
^
compilation terminated.
|