太原理工大学软件java实验报告(9)
发布时间:2021-06-12
发布时间:2021-06-12
import java.io.*;;
public class Juzhen {
}
public static void main(String[] args) throws IOException { }
// TODO Auto-generated method stub int a[][] =new int[3][3];
System.out.println("请输入3*3矩阵:"); BufferedReader br = new BufferedReader(new String str;
for(int i=0;i<3;i++)
for(int j =0;j<3;j++){ }
str = br.readLine();
a[i][j]=Integer.parseInt(str);
InputStreamReader(System.in));
int s=a[0][0]+a[1][1]+a[2][2];
System.out.println("矩阵对角元素之和为:"+s);
(3) 输入一段字符串,统计其中有多少个单词。(单词用空格隔开) package com.zhangqian.exercise1;
import java.io.*;
public class Danci {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub System.out.println("请输入字符串:"); String str;
BufferedReader br = new BufferedReader(new
上一篇:宜春一对一辅导机构哪家好