- import java.util.Scanner;
- public class Ch11 {
-
- static int f(int b)
- {
- if(b==1)
- {
- return 1;
-
- }else
- {
- return b*f(b-1);
-
- }
- }
- public static void main(String[] args) {
-
- Scanner s=new Scanner(System.in);
- int a=3,b=5;
- double t=21.985;
- String str1="dog",str2="cat";
- System.out.printf("There are %d%ss and %d %Ss totally weight%.2f pounds",a,str1,b,str2,t);
-
-
-
-
- }
- }
複製代碼 |