herrDeng網內搜尋

自訂搜尋

Ads

2015年10月30日 星期五

ex6 估計Euler constant e

ex6 估計Euler constant e

45 則留言:

匿名 提到...

try webproxy

A10433001 提到...



public class ex_01 { static double show(int n){ double p=1; for(int i=2;i<=n;i++) p=p*i; return p; } public static void main(String[] args) { int n=20; double sum=0; for(int i=0;i<=n;i++) sum+=1.0/show(i); System.out.println(sum); }}

A10433008 提到...

public class ex1030 { static double show(int n){ double p=1; for(int i=2; i<=n; i++){ p=p*i; } return p; } public static void main(String[] args) { int n=20; double sum=0; for(int i=0; i<=n ;i++) sum+=1.0/show(i); System.out.println(sum); } }

A10433006 提到...

public class ex1030 { static double show(int n){ double p=1; for(int i=2; i<=n; i++){ p=p*i; } return p; } public static void main(String[] args) { int n=20; double sum=0; for(int i=0; i<=n ; i++) sum+=1.0/show(i); System.out.println(sum); }

}

B10133007 提到...

public class b1013300701 { static double factorial(int n){ double p=1; for(int i=2; i<=n; i++){ p=p*i; } return p; }

public static void main(String[] args) { double sum=0; int N=20; for(int i=0; i<=N ;i++){ sum+=1.0/factorial(i); } System.out.println(sum); }

}

A10433004 提到...

public class exx1 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0; i<=n; i++){
sum+=1.0/factorial(i);
}
System.out.println(sum);
}
}

A10433038 提到...

public class jimmy111 {
static double factorial (int n){
double p=1;
for(int i=2;i<n;i++){
p=p*i;
}
return p;
}

public static void main(String[] args) {
int n=22;

System.out.println(factorial(12));
}
}

A10433038 提到...

public class jimmy111 { static double factorial (int n){ double p=1; for(int i=2;i<n;i++){ p=p*i; } return p; }

public static void main(String[] args) { int n=22; System.out.println(factorial(12)); }}

匿名 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

A10433011 提到...


public class A10433011 {
static double factorial(int n){
double p = 1;
for (int i=2;i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[]args){
double sum=0;
int n =20;
for(int i=0; i<=n; i++){
sum+=1.0/factorial(i);
}

System.out.println(sum);
}

A10433043 提到...

public class A10433043 {
static double show(int n){
double p=1;
for(int i=2;i<=n;i++)
p=p*i;
return p;
}
public static void main(String[] args) {
int n=20;
double sum=0;
for(int i=0;i<=n;i++)
sum+=1.0/show(i);
System.out.println(sum);

}

}

匿名 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

a10433029 提到...

A10433029
public class ex1041030 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n; i++){
sum+=1.0/factorial(i);
}
System.out.println(sum);
}
}

匿名 提到...


public class gg {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i
}
return p;
}
public static void main(String[] args) {
double sum=0
int n=20;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
}
System.out.print(sum);
}
}

A10433036 提到...

public class A10433043 {
static double show(int n){
double p=1;
for(int i=2;i<=n;i++)
p=p*i;
return p;
}
public static void main(String[] args) {
int n=20;
double sum=0;
for(int i=0;i<=n;i++)
sum+=1.0/show(i);
System.out.println(sum);

}

}

匿名 提到...

A10433018


public class gg {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i
}
return p;
}
public static void main(String[] args) {
double sum=0
int n=20;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
}
System.out.print(sum);
}
}

A10433039 提到...

public class A10433043 {
static double show(int n){
double p=1;
for(int i=2;i<=n;i++)
p=p*i;
return p;
}
public static void main(String[] args) {
int n=20;
double sum=0;
for(int i=0;i<=n;i++)
sum+=1.0/show(i);
System.out.println(sum);

}

}

A10433039 提到...

public class A10433043 {
static double show(int n){
double p=1;
for(int i=2;i<=n;i++)
p=p*i;
return p;
}
public static void main(String[] args) {
int n=20;
double sum=0;
for(int i=0;i<=n;i++)
sum+=1.0/show(i);
System.out.println(sum);

}

}

匿名 提到...

A10433024


public class gg {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i
}
return p;
}
public static void main(String[] args) {
double sum=0
int n=20;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
}
System.out.print(sum);
}
}

匿名 提到...

A10433022
public class EX1 {
public static void main(String[] args) {
double p=1;
double sum=1;
int n=1000000;
for(int i=1; i<=n; i++){
p=i*p;
sum=sum+1.0/p;
}
System.out.println(sum);
}
}

A10433013 提到...

import java.util.Scanner;

public class tast1 {

public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("輸入階層N"); int x=input.nextInt(); double p=1,sum=1; for(int i=1; i<=x ;i++){ p*=i; sum=sum+1/p; } System.out.println(sum); }}

匿名 提到...

a10433029

public class ex1041030 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n; i++){
sum+=1.0/factorial(i);
}
System.out.println(sum);
}
}

A10433028 提到...

public class GG {

public static void main(String[] args) { double n=100000,p=1,i,a=1; for(i=1;i<=n;i++){ p=p*i; a=a+1.0/p;} System.out.println(a); }}

A10433007 提到...

public class GG {

public static void main(String[] args) { double n=100000,p=1,i,a=1; for(i=1;i<=n;i++){ p=p*i; a=a+1.0/p;} System.out.println(a); }}

匿名 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

A10433015 提到...

import java.util.Scanner;public class zx { public static void main(String[] args) { int x; double d=1; double c =1 ; Scanner a = new Scanner(System.in); System.out.println("N="); x= a.nextInt(); for (int n=1;n<=x;n++){ c=n*c; d+=1.0/c;} System.out.println(d);}

匿名 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

匿名 提到...

a10433029

public class ex1041030 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n; i++){
sum+=1.0/factorial(i);
}
System.out.println(sum);
}
}

匿名 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

B10133189 提到...


public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

A10433019 提到...


public class hello123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}

public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0; i<=n ;i++){
sum+=1.0/factorial(i);

}

System.out.println(sum);
}
}
id="result-source" class="sh_html sh_sourceCode"><span class="sh_keyword" 

A10433038 提到...

public class jimmy111 { static double factorial (int n){ double p=1; for(int i=2;i<n;i++){ p=p*i; } return p; }

public static void main(String[] args) { int n=20; double sum=0; for(int i=0; i<=n; i++) sum+=1.0/factorial(i); System.out.println(sum); System.out.println(Math.E); }

B10133189 提到...


public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

A10433010 提到...

public class cgvcb {
public static void main(String[] args) {
double p=1;
double sum=1;
int n=100;
for (int i=1; i<=n; i++){
p=i*p;
sum=sum+1.0/p;
}
System.out.println(sum);


}
}

匿名 提到...

A10433018


public class gg {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i
}
return p;
}
public static void main(String[] args) {
double sum=0
int n=20;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
}
System.out.print(sum);
}
}

A10433029 提到...


public class ex1041030 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n; i++){
sum+=1.0/factorial(i);
}
System.out.println(sum);
}
}

匿名 提到...

A10433024


public class gg {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i
}
return p;
}
public static void main(String[] args) {
double sum=0
int n=20;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
}
System.out.print(sum);
}
}

A10433010 提到...

public class cgvcb {
public static void main(String[] args) {
double p=1;
double sum=1;
int n=100;
for (int i=1; i<=n; i++){
p=i*p;
sum=sum+1.0/p;
}
System.out.println(sum);


}
}

B10133189 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

A10433003 提到...

package hello;

public class EX1 {
static double factorial(int n){
double p=1;
for (int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
long n=20;
double sum=1;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
System.out.println(sum);
}

}

A10433014 提到...

package hello;

public class EX1 {
static double factorial(int n){
double p=1;
for (int i=2; i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[] args) {
long n=20;
double sum=1;
for(int i=1; i<=n; i++)
sum+=1.0/factorial(i);
System.out.println(sum);
}

}

B10133189 提到...


public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

匿名 提到...

B10133189

public class He123 {
static double factorial(int n){
double p=1;
for(int i=2; i<=n; i++){
p=p*i;
}
return p;
}


public static void main(String[] args) {
double sum=0;
int n=20;
for(int i=0;i<=n ;i++)
sum+=1.0/factorial(i);



System.out.println(sum);
}

匿名 提到...

public class A10433022 {
static double factorial(int n){
double p = 1;
for (int i=2;i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[]args){
double sum=0;
int n =20;
for(int i=0; i<=n; i++){
sum+=1.0/factorial(i);
}

System.out.println(sum);
}

10433020 遲 提到...

static double factorial(int n){
double p = 1;
for (int i=2;i<=n; i++){
p=p*i;
}
return p;
}
public static void main(String[]args){
double sum=0;
int n =20;
for(int i=0; i<=n; i++){
sum+=1.0/factorial(i);
}

System.out.println(sum);
}

Related Posts Plugin for WordPress, Blogger...

熱門文章