package com.sj.zy;
import java.io.File;
import java.io.IOException;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
public class 九九乘法表 {
public static void main(String[] args) throws RowsExceededException, WriteException, IOException {
// TODO 自动生成的方法存根
String path = "D://测试.xls";
File file = new File(path);
WritableWorkbook workbook = Workbook.createWorkbook(file);
WritableSheet sheet = workbook.createSheet("第一页", 0);
for (int i = 0; i <=8; i++) {
for (int j = 0; j < i+1; j++) {
Label label=new Label(j,i, j+1+"*"+(i+1)+"="+((i+1)*(j+1))+" ");
sheet.addCell(label);
}
}
System.out.println("写入成功!");
workbook.write();
workbook.close();
}
}