我创造了这个卢恩检查(或国防部10检查)在Java和偶数和奇数总和不正确添加了,我想不通为什么。当我单独编写了一个部分并且它看起来工作正常时,它起作用。作为一个整体程序与所有其他方法,它不起作用。有人有主意吗? 输入号码4388576018410707应该是有效的。 import java.util.Scanner;
import java.io.*;
public class combin
我使用Luhn算法验证信用卡时遇到问题。 我使用此C#代码: void ServerValidation(object source, ServerValidateEventArgs args)
{
// use a RequiredFieldValidator to check for an empty value
if (CreditCardNumber.Te
我想通过这样来总结卡号每隔位: /*
Return the sum of the odd-place digits.
*/
public static int sumOfoddPlace(long number)
{
int maxDigitLength = 16;
int sum = 0;
for (int i = 1; i <= maxDigitLeng