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


  2. public class Ch11 {
  3.        
  4.         static int  f(int b)
  5.         {
  6.                 if(b==1)
  7.                 {
  8.                return 1;
  9.                
  10.                 }else
  11.                 {
  12.                         return b*f(b-1);
  13.                                        
  14.                 }
  15.         }

  16.         public static void main(String[] args) {
  17.                
  18.                 Scanner s=new Scanner(System.in);
  19.                 int a=3,b=5;
  20.                 double t=21.985;
  21.                 String str1="dog",str2="cat";
  22.                 System.out.printf("There are %d%ss and %d %Ss totally weight%.2f pounds",a,str1,b,str2,t);
  23.                
  24.                
  25.                
  26.       

  27.         }

  28. }
複製代碼

TOP

返回列表