急~~谁能帮忙解答一下这几道java题目?谢谢了

2024-11-29 12:13:40
推荐回答(1个)
回答1:

import java.util.Scanner;
public class test{
public static void fangzhen(){
Scanner sc=new Scanner(System.in);
int p[][]=new int[10][10];
for(int i=0;i<100;i++){
p[i/10][i%10]=sc.nextInt();
}
int sum=1;
for(int i=0;i<10;i++){
sum*=p[i][i];
sum*=p[i][9-i];
}
System.out.println(sum);
}

public static void juzheng(){
Scanner sc=new Scanner(System.in);
int m=sc.nextInt();
int n=sc.nextInt();
int p[][]=new int[m][n];
int minx=0;
int miny=0;
int min=0;
for(int i=0;ip[i/n][i%n]=sc.nextInt();
}
min=p[0][0];
for(int i=1;iif(min>p[i/n][i%n]){
minx=i/n;
miny=i%n;
min=p[i/n][i%n];
}
}
System.out.println("hang="+minx+" lie="+miny);
}

public static void jimu(){
Scanner sc=new Scanner(System.in);
String n=sc.next();
int da=0;
int xiao=0;
int shu=0;
int kong=0;
int qi=0;
for(int i=n.length()-1;i>-1;i--){
char c=n.charAt(i);
System.out.println(c);
if(c=' ')
kong++;
else if(c>='0'&&c<='9')
shu++;
else if(c>='a'&&c<='z')
xiao++;
else if(c>='A'&&c<='Z')
da++;
else
qi++;
System.out.println("大写="+da+"小写="+xiao+"数字="+shu+"空格="+kong+"其他="+qi);
}
}
public static void main(String dasfdsa[]){
fangzhen();
juzheng();
jimu();
}
}