返回列表 發帖
  1. import java.util.Scanner;

  2. public class Ch01
  3. {
  4.         public static void main(String[]args)
  5.         {
  6.                 Scanner s=new Scanner(System.in);
  7.                 String str1="dog",str2="cat";
  8.                 int a=3,b=5;
  9.                 double total=21.3568;
  10.                 System.out.printf("There're %d %ss and %d %Ss totally weigh %.2f pounds.",a,str1,b,str2,total);;
  11.         }

  12. }
複製代碼

TOP

返回列表