Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1.  
  2. Console.WriteLine("введите номер кашей карты");
  3. string cardNumber = Console.ReadLine();
  4. int count = cardNumber.Length;
  5. long card = long.Parse(cardNumber);
  6. if (13 <= count && count <= 16)
  7. {
  8.  
  9. while (card > 10)
  10. {
  11. card = card / 10;
  12.  
  13. }
  14. Console.WriteLine(card);
  15. if (card == 4)
  16. {
  17. Console.WriteLine("Your card type is Visa");
  18. }
  19. if (card == 5)
  20. {
  21. Console.WriteLine("Your card type is MasterCard");
  22. }
  23. if (card == 6)
  24. {
  25. Console.WriteLine("Your card type is Discover cards");
  26. }
  27. while (card > 100)
  28. {
  29. long x = card % 100 / 10;
  30. card = card / 100;
  31. Console.WriteLine(x);
  32. }
  33.  
  34. }
  35.  
  36.  
  37. else
  38. {
  39.  
  40. Console.WriteLine("invalid card number");
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement