import java.util.Scanner;
public class tt {
public static void main(String[] args) {
String a[] = { "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10",
"jack", "queen", "king" };
int n1 = (int) (Math.random() * 13);
System.out.print("The card is ");
System.out.print(a[n1]);
String b[] = { "Clubs", "Diamonds", "Hearts", "Spades" };
int n2 = (int) (Math.random() * 4);
System.out.print(" of " + b[n2]);
}
}
结果:
The card is 8 of Clubs