Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PlayingCards2 {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- for (int i = n; i <= 52; i++) {
- int card = ((i - 1) / 4) + 1;
- int color = i % 4;
- if (color == 1) {
- System.out.println();
- }
- switch (card) {
- case 1:
- System.out.print("Двойка ");
- break;
- case 2:
- System.out.print("Тройка ");
- break;
- case 3:
- System.out.print("Четворка ");
- break;
- case 4:
- System.out.print("Петица ");
- break;
- case 5:
- System.out.print("Шестица ");
- break;
- case 6:
- System.out.print("Седмица ");
- break;
- case 7:
- System.out.print("Осмица ");
- break;
- case 8:
- System.out.print("Девятка ");
- break;
- case 9:
- System.out.print("Десятка ");
- break;
- case 10:
- System.out.print("Вале ");
- break;
- case 11:
- System.out.print("Дама ");
- break;
- case 12:
- System.out.print("Поп ");
- break;
- case 13:
- System.out.print("Асо ");
- break;
- }
- switch (color) {
- case 1:
- System.out.print("Спатия, ");
- break;
- case 2:
- System.out.print("Каро, ");
- break;
- case 3:
- System.out.print("Купа, ");
- break;
- case 0:
- if (i == 52) {
- System.out.print("Пика");
- } else {
- System.out.print("Пика, ");
- }
- break;
- }
- }
- //main ends here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement