import?java.util.Scanner;
public?class?Test6?{
public?static?void?main(String[]?args)
{
int?i;
????float?sum=0;
Scanner?scanner=new?Scanner(System.in);
System.out.print("輸入n:");
int?n=scanner.nextInt();
for(i=1;i<=n;i++)
{
sum+=1/(3*i);
}
System.out.print(sum);
}
}
java題目,為什么老是這樣的錯(cuò)誤,如圖
erutdioup8556
2015-10-12 21:59:23