代码
int a;
Double sum = 0.0;
System.out.print("Length of num you want to add: ");
a = in.nextInt();
num = new double [a];
for(int i = 0;i<num.length;i++)
{
System.out.print("Num["+(i+1)+"]:" );
num[i] = in.nextDouble();
sum += num[i];
System.out.println("Sum:" + sum);
我希望代码是除法而不是加法
万千封印
相关分类