Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.WriteLine("введите номер кашей карты");
- string cardNumber = Console.ReadLine();
- int count = cardNumber.Length;
- long card = long.Parse(cardNumber);
- if (13 <= count && count <= 16)
- {
- while (card > 10)
- {
- card = card / 10;
- }
- Console.WriteLine(card);
- if (card == 4)
- {
- Console.WriteLine("Your card type is Visa");
- }
- if (card == 5)
- {
- Console.WriteLine("Your card type is MasterCard");
- }
- if (card == 6)
- {
- Console.WriteLine("Your card type is Discover cards");
- }
- while (card > 100)
- {
- long x = card % 100 / 10;
- card = card / 100;
- Console.WriteLine(x);
- }
- }
- else
- {
- Console.WriteLine("invalid card number");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement