import java.util.Scanner;

為沙市等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及沙市網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為網(wǎng)站制作、成都做網(wǎng)站、沙市網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!
public class Matrix {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("請(qǐng)輸入n*n數(shù)組,n=");
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] a = new int[n][n];//定義n*n數(shù)組
int result = 0;
for(int i=0; in; i++){
for(int j=0; jn; j++){
System.out.println("請(qǐng)輸入第"+i+"行,第"+j+"列元素:");
a[i][j]=sc.nextInt();
}
result +=a[i][i];
}
System.out.println("對(duì)角線元素和為:"+result);
}
}
public?class?Matrix?{
//?表示行和列
private?int?mRow,?mColumn;
//?構(gòu)造方法
public?Matrix(int?row,?int?column)?{
mRow?=?row;
mColumn?=?column;
}
//?獲取0-20隨機(jī)數(shù)
private?int?random()?{
double?random1?=?Math.random();//?這個(gè)Math類的方法可以獲取0.0-1.0之間的隨機(jī)數(shù)
double?random2?=?random1?*?20;?//?0.0?-?20.0
return?(int)?random2;
}
//?創(chuàng)建矩陣
private?void?createMatrix()?{
int?totalCount?=?mRow?*?mColumn;?//?總共有那么多
for?(int?count?=?1;?count?=?totalCount;?count++)?{
int?number?=?random();//?上面的方法
System.out.print(number??10???"0"?+?number?:?number);?//?輸出數(shù)字,如果數(shù)字小于10,前面加0補(bǔ)全兩位
System.out.print("?");?//?分隔符,隨便填
if?(count?%?mRow?==?0)?{
System.out.println();?//?換行
}
}
}
public?static?void?main(String[]?args)?{
Matrix?matrix?=?new?Matrix(3,?5);?//?幾行幾列傳進(jìn)去
matrix.createMatrix();
}
}
為了經(jīng)驗(yàn)我也是蠻拼的了
u'x=1/(x+y^2+z^3)
u'y=2y/(x+y^2+z^3)
u'z=3z^2/(x+y^2+z^3)
du=u'xdx+u'ydy+u'zdz
=1/(x+y^2+z^3)dx+2y/(x+y^2+z^3)dy+3z^2/(x+y^2+z^3)dz
當(dāng)前題目:矩陣模式識(shí)別java代碼,矩陣模式識(shí)別java代碼是多少
轉(zhuǎn)載注明:http://chinadenli.net/article7/dsgpeoj.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、網(wǎng)站設(shè)計(jì)公司、網(wǎng)站制作、用戶體驗(yàn)、面包屑導(dǎo)航、企業(yè)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)