展开全部
public class Test{
public static void main(String args[])
{
int arr[] = {1,2,3,4,5,6,7,8,9,10};
int sum = 0;
int avg=0
for (int i=0;i<10;i++){
sum +=i;
}
avg=sum/10;
System.out.println("sum="+sum);
System.out.println("avg="+avg);
}
public static void main(String args[])
{
int arr[] = {1,2,3,4,5,6,7,8,9,10};
int sum = 0;
int avg=0
for (int i=0;i<10;i++){
sum +=i;
}
avg=sum/10;
System.out.println("sum="+sum);
System.out.println("avg="+avg);
}
更多追问追答
追问
谢谢啊
追答
满意请采纳
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询