本帖最後由 李泳霖 於 2023-7-1 11:09 編輯
a015: 矩陣的翻轉
 - import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Ch01 {
- BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
- int r,c;
- int a[][];
- String str;
- String raw[];
- Ch01() throws NumberFormatException, IOException
- {
- while((str=br.readLine())!=null)
- {
- raw=str.split(" ");
- r=Integer.parseInt(raw[0]);
- c=Integer.parseInt(raw[1]);
- System.out.println(r+"列"+c+"欄");
- }
- }
- public static void main(String[] args) throws NumberFormatException, IOException {
- new Ch01();
- }
- }
複製代碼 |