python
f = open('d:/python.txt', 'w')for i in range(10000, 9999999): f.write(str(i)+'\n')f.close()
java
public static void main(String[] args) { int start = 10000; int end = 999999; int period = 10000; String tmp = ""; String file = "d:/java.txt"; FileWriter fw = null; try { fw = new FileWriter(file); for (int i = start; i < end; i++) { tmp += i + "\n"; if (i % period == 0) { // 写文件 fw.write(tmp); tmp = ""; } } } catch (IOException e) { e.printStackTrace(); } finally { if (fw != null) { try { fw.close(); } catch (IOException e) { e.printStackTrace(); } } } }