2个回答
2013-12-06
展开全部
貌似没人的啊........向专家求助!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-12-06
展开全部
import java.util.Scanner;
public class test {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
double[][] a = new double[4][5];
for(int i = 0; i < 4; ++i)
for(int j = 0; j < 5; ++j) {
System.out.printf("a[%d][%d]=",i, j);
a[i][j] = sc.nextDouble();
}
double[] b = new double[4];
for(int i = 0; i < 4; ++i) {
for(int j = 0; j < 5; ++j) {
b[i] += a[i][j];
System.out.print(a[i][j] + " ");
}
System.out.println();
}
System.out.println("各行的和分别为: ");
for(double i : b)
System.out.print(i + " ");
}
}
public class test {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
double[][] a = new double[4][5];
for(int i = 0; i < 4; ++i)
for(int j = 0; j < 5; ++j) {
System.out.printf("a[%d][%d]=",i, j);
a[i][j] = sc.nextDouble();
}
double[] b = new double[4];
for(int i = 0; i < 4; ++i) {
for(int j = 0; j < 5; ++j) {
b[i] += a[i][j];
System.out.print(a[i][j] + " ");
}
System.out.println();
}
System.out.println("各行的和分别为: ");
for(double i : b)
System.out.print(i + " ");
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询