这里是程序public class MonteCarlo {	public static void main(String[] args) {				double [] x=new double[100000];		double [] y = new double [100000];		int i;		int count=0;		for( i = 1;i<100000;i++){			y[i]= Math.random()*Math.pow(Math.E, -0.7);			x[i]=1-Math.random()*0.5;			x[0]=1-Math.random()*0.5;			y[0]= Math.random()*Math.pow(Math.E, -0.7);			for(int j=0;j<i;j++){								while(x[i]==x[j]&&y[i]==y[j] ){			         i--;				}					 			}   		//帮我判断一下这里的循环中的x[i],y[i]是否经过上一个循环的筛选,若没有该怎么改	 			 if(y[i]<Math.pow(Math.E, -0.7/x[i])){										count=count+1;					}			}		System.out.println("总共:"+count);	}}
                    
                    
                添加回答
举报
0/150
	提交
		取消
	