Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company.tests;
- import java.util.Scanner;
- public class Main {
- private static final String[] inputs = {"g", "j", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"};
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String inputStr = scanner.nextLine();
- int times = Integer.parseInt(inputStr);
- /*
- char spade = '\u2660';
- char heart = '\u2661';
- char diamond = '\u2662';
- char club = '\u2663';
- */
- if (times > 1 && times < 15) {
- for (int i = 0; i < inputs.length; i++) {
- if (inputStr.equals(inputs[i])) {
- for (int j = i; j < inputs.length; j++) {
- System.out.printf("%s of spades, %s of clubs, %s of hearts, %s of diamonds", inputs[j], inputs[j], inputs[j], inputs[j]);
- System.out.println();
- }
- }
- }
- if (times > 10){
- for (int j = times; j < inputs.length; j++) {
- System.out.printf("%s of spades, %s of clubs, %s of hearts, %s of diamonds", inputs[j], inputs[j], inputs[j], inputs[j]);
- System.out.println();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement