返回列表 發帖

20220521遞迴小測驗

本帖最後由 葉桔良 於 2022-5-21 14:40 編輯

本帖隱藏的內容需要回復才可以瀏覽


402
  1. import java.util.Scanner;
  2. public class JPD04 {
  3.     static Scanner keyboard = new Scanner(System.in);
  4.     public static void main(String args[]) {
  5.         
  6.     ...

  7.     }
  8.     ...
  9. }
複製代碼
403
  1. import java.util.Scanner;
  2. public class JPD04 {
  3.     static Scanner keyboard = new Scanner(System.in);
  4.     public static void main(String args[]) {
  5.         
  6.     ...



  7.     }
  8.    
  9.    
  10.     ...

  11. }
複製代碼
408
  1. import java.util.Scanner;
  2. public class JPD04 {
  3.     static Scanner keyboard = new Scanner(System.in);
  4.     public static void main(String args[]) {
  5.         String s, c;
  6.         System.out.print("Input a string: ");
  7.         s = keyboard.nextLine();
  8.         System.out.printf("%s\n", reverse(s));
  9.         System.out.print("Input a string: ");
  10.         s = keyboard.nextLine();
  11.         System.out.printf("%s\n", reverse(s));
  12.     }
  13.    
  14.     ...
  15. }
複製代碼

返回列表