摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1071View Code //抛物线 yp=a*(x-b)^2+c;//直线 yz=k*x+s;//二重积分公式: f(x0,x1)(yp-yz)*dx;#include"iostream"usingnamespace std;double a,b,c,k,s;double fun(double x){ return1.0*(a*x*x*x/3)-1.0*(a*b+k/2)*x*x+(a*b*b+c-s)*x;}int main(){ int t; double x1,y1,x2,y2,x 阅读全文
摘要:
View Code #include"iostream"using namespace std;int prime(int x){ int i; if(x%2==0&&x!=2) return 0; //此处剪枝可以提高效率,要不超时 for(i=3;i<=sqrt(x);i+=2) { if(x%i==0) return 0; } return 1;}int main(){ int n,m; int i; while(cin>>n) { int count=0; for(i=0; i<n; i++) { cin>>m; 阅读全文