我叫王超然,是一名电脑爱好者,现在在新加坡留学上高一.我立志成为一名电脑人才,愿意在这里与大家一同分享我玩转电脑的心得.O-level华文考了A-One哈哈!
天气: 晴朗
心情: 高兴
/*fileName:P5Q12.java
*Name:Wang Chaoran
* Description:
12 (Computing series)
Write a method to compute the following series:
*/
import java.util.Scanner;
public class P5Q12{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("Please enter an integer");
int i = scan.nextInt();
System.out.println("m(i)="+ m(i));
}
public static double m(int i){
double sum = 0;
for(double j=1;j<=i;j++){
sum += j/(j+1);
}
return sum;
}
}
导入论坛查看(51)回复(0)引用(0)好评(0) 差评(0)
加入收藏
编辑
审核
TAG:
computing