public class Cards { public void CreadCards(){ String Colour[] = new String[4]; Colour[0] = "黑桃"; Colour[1] = "红桃"; Colour[2] = "梅花"; Colour[3] = "方块"; String number = "234567890JQKA"; String Cards[] = new String[52]; int m = 0; for(int i = 0;i < 13;i++) for(int j = 0;j < 4;j++) if(i == 8){ Cards[m] = "1" + number.charAt(i) + Colour[j]; m++; } else{ Cards[m] = number.charAt(i) + Colour[j]; m++; } } public static void main (String [] args){ Cards cards = new Cards(); cards.CreadCards(); } }
球看,哪里有问题?????
没有输出语句!
public class Cards {
public void CreadCards() {
String Colour[] = new String[4];
Colour[0] = "黑桃";
Colour[1] = "红桃";
Colour[2] = "梅花";
Colour[3] = "方块";
String number = "234567890JQKA";
String Cards[] = new String[52];
int m = 0;
for (int i = 0; i < 13; i++) {
for (int j = 0; j < 4; j++)
if (i == 8) {
Cards[m] = "1" + number.charAt(i) + Colour[j];
m++;
} else {
Cards[m] = number.charAt(i) + Colour[j];
m++;
}
}
for (String string : Cards) {
System.out.println(string);
}
}
public static void main(String[] args) {
A cards = new A();
cards.CreadCards();
}
}