BLACK JACK
Problem Description
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, with blackjack and other really cool stuff? Many people will surely be willing to visit this splendid shrine of high culture.
In Mainframe a standard pack of 52 cards is used to play blackjack. The pack contains cards of 13 values: 2, 3, 4, 5, 6, 7, 8, 9, 10, jacks, queens, kings and aces. Each value also exists in one of four suits: hearts, diamonds, clubs and spades. Also, each card earns some value in points assigned to it: cards with value from two to ten earn from 2 to 10 points, correspondingly. An ace can either earn 1 or 11, whatever the player wishes. The picture cards (king, queen and jack) earn 10 points. The number of points a card earns does not depend on the suit. The rules of the game are very simple. The player gets two cards, if the sum of points of those cards equals n, then the player wins, otherwise the player loses.
The player has already got the first card, it's the queen of spades. To evaluate chances for victory, you should determine how many ways there are to get the second card so that the sum of points exactly equals n.
Input Format
The only line contains n (1 n 25) the required sum of points. If the input value is outside this range, print Invalid Input
Output Format
Print the numbers of ways to get the second card in the required way if the first card is the queen of spades
CODING ARENA
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
if(n>=1&&n<=25)
{
n=n-10;
if(n>11)
printf("Invalid Input\n");
else if(n==11)
printf("4\n");
else if(n==10)
printf("15\n");
else if(n<10&&n>=1)
printf("4\n");
else if(n<=0)
printf("Invalid Input\n");
}
else
printf("Invalid Input");
return 0;
}
Test Case 1
Input (stdin)12
Expected Output
4
Test Case 2
Input (stdin)30
Expected Output
Invalid Input
GRSoft Gaming is an honor winning, Live Casino game advancement organization of India. We offer curiosity and inventive game development with an exceptionally talented group of developer. Our bleeding edge gaming innovation creates esteem included gaming arrangements. Quality is our real worry for club game development. We offer tweaked Casino game development benefits over the globe and help you furnish with customized development. With our Casino game, individuals couldn't imagine anything better than to chance their gaining and appreciate the advantages. We have created numerous effective games like the video poker game, Sports wagering game, online club game, lottery games, and numerous other common games.
ReplyDeleteCasino Games Software Developers UK, USA - Casino Game Development UK, USA
GRSoft Gaming is an honor winning, Live Casino game advancement organization of India. We offer curiosity and inventive game development with an exceptionally talented group of developer. Our bleeding edge gaming innovation creates esteem included gaming arrangements. Quality is our real worry for club game development. We offer tweaked Casino game development benefits over the globe and help you furnish with customized development. With our Casino game, individuals couldn't imagine anything better than to chance their gaining and appreciate the advantages. We have created numerous effective games like the video poker game, Sports wagering game, online club game, lottery games, and numerous other common games.
ReplyDeleteLegacy Application Modernization India | Legacy Application Migration Services Company
Nice article, thank you for sharing wonderful information. I am happy to found your blog on the internet related to black jack.
ReplyDeleteYou can also check: blackjack simulator software
Вот тут шикраная статья про блэкджек и его правила.
ReplyDelete