import java
public class nc
public static void main(String[] args) throws Exception {
// TODO Auto
int[] date = new int[
date[
int weishu =
System
System
System
Scanner cin = new Scanner(System
int n = cin
for (int i =
for (int j =
date[j] = date[j] * i;
}
// 確保除最高位外的每位不大於
for (int j =
if (date[j] >=
date[j +
date[j] = date[j] %
}
}
//確保最高位不大於
while (date[weishu] >=
weishu++;
date[weishu] += date[weishu
date[weishu
}
}
System
for (int k = weishu; k >=
System
}
System
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/27042.html