藍橋杯 8 16複習

2021-10-09 05:42:17 字數 1054 閱讀 5031

字串轉化字元陣列

char 陣列名[

]=字串名.

tochararray()

;

以逗號為分界將字串存入字串/整數陣列(只做arr到brr的轉換就是存入string 陣列)
scanner sc=

newscanner

(system.in)

; string arr=sc.

nextline()

; string[

] brr =arr.

split

(",");

char crr=

newchar

[brr.length]

;/* for(int i=0;i

for(

int i=

0;i)}

以回車為界輸入陣列
scanner sc1=

newscanner

(system.in)

;int drr=

newint

[100];

for(

int j=

0;j<

4;j++

)for

(int j=

0;j<

4;j++

)

輸入二維陣列(可以以回車乙個乙個輸,也可以空格加回車模擬陣列形狀輸入)(兩種輸出換行語法)
scanner sc=

newscanner

(system.in)

;int

err=

newint[5

][2]

;for

(int x=

0;x<

5;x++)}

for(

int x=

0;x<

5;x++

)// system.out.println("");

system.out.

print

("\n");

}}

複習 藍橋杯 方陣轉置

對乙個方陣轉置,就是把原來的行號變列號,原來的列號變行號 例如,如下的方陣 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 轉置後變為 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 但,如果是對該方陣順時針旋轉 不是轉置 卻是如下結果 1...

記錄藍橋杯校內選拔複習

總體來講,假複習。回顧了筆記和演算法競賽入門的ppt和自己大二第一學期寫的演算法題,但都是大概去理解了下,感覺就像高中考數學似的,去看看概念,然後到考試之後啥都不會。儘管是假複習,但還是有點心得的。三 演算法理解 1 動態規劃 自下而上,大問題分解為小問題,且大小問題有關聯。例題 石子合併,割繩子,...

藍橋杯 面對藍橋杯的基礎演算法複習快速總結

搜尋 1.dfs 八皇后迭代 include using namespace std int n,tot 0 int a 20 bool is ok int row return true void dfs int row int bk 105 105 struct nodenode,p queue...