Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _4.PokerStraight
- {
- using System;
- public class PokerStraight
- {
- public static void Main(string[] args)
- {
- checked
- {
- long targetW = long.Parse(Console.ReadLine());
- int countHands = 0;
- for (int f1 = 1; f1 < 11; f1++)
- {
- for (int s1 = 1; s1 <= 4; s1++)
- {
- int f2 = f1 + 1;
- for (int s2 = 1; s2 <= 4; s2++)
- {
- int f3 = f2 + 1;
- for (int s3 = 1; s3 <= 4; s3++)
- {
- int f4 = f3 + 1;
- for (int s4 = 1; s4 <= 4; s4++)
- {
- int f5 = f4 + 1;
- for (int s5 = 1; s5 <= 4; s5++)
- {
- long currentWeight =
- ((f1 * 10) + s1) + ((f2 * 20) + s2) + ((f3 * 30) + s3) + ((f4 * 40) + s4) + ((f5 * 50) + s5);
- if (currentWeight == targetW)
- {
- countHands++;
- }
- }
- }
- }
- }
- }
- }
- Console.WriteLine(countHands);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement