Advertisement
KeepCoding

PlayingCardsBGVersion

Nov 27th, 2017
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PlayingCards2 {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.  
  7.         int n = Integer.parseInt(console.nextLine());
  8.         for (int i = n; i <= 52; i++) {
  9.             int card = ((i - 1) / 4) + 1;
  10.             int color = i % 4;
  11.             if (color == 1) {
  12.                 System.out.println();
  13.             }
  14.             switch (card) {
  15.                 case 1:
  16.                     System.out.print("Двойка ");
  17.                     break;
  18.                 case 2:
  19.                     System.out.print("Тройка ");
  20.                     break;
  21.                 case 3:
  22.                     System.out.print("Четворка ");
  23.                     break;
  24.                 case 4:
  25.                     System.out.print("Петица ");
  26.                     break;
  27.                 case 5:
  28.                     System.out.print("Шестица ");
  29.                     break;
  30.                 case 6:
  31.                     System.out.print("Седмица ");
  32.                     break;
  33.                 case 7:
  34.                     System.out.print("Осмица ");
  35.                     break;
  36.                 case 8:
  37.                     System.out.print("Девятка ");
  38.                     break;
  39.                 case 9:
  40.                     System.out.print("Десятка ");
  41.                     break;
  42.                 case 10:
  43.                     System.out.print("Вале ");
  44.                     break;
  45.                 case 11:
  46.                     System.out.print("Дама ");
  47.                     break;
  48.                 case 12:
  49.                     System.out.print("Поп ");
  50.                     break;
  51.                 case 13:
  52.                     System.out.print("Асо ");
  53.                     break;
  54.             }
  55.             switch (color) {
  56.                 case 1:
  57.                     System.out.print("Спатия, ");
  58.                     break;
  59.                 case 2:
  60.                     System.out.print("Каро, ");
  61.                     break;
  62.                 case 3:
  63.                     System.out.print("Купа, ");
  64.                     break;
  65.                 case 0:
  66.                     if (i == 52) {
  67.                         System.out.print("Пика");
  68.                     } else {
  69.                         System.out.print("Пика, ");
  70.                     }
  71.                     break;
  72.             }
  73.  
  74.         }
  75.  
  76.         //main ends here
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement