# * # * # * # * #
* # * # * # * # *
# * # * # * # * #
* # * # * # * # *
# * # * # * # * #
* # * # * # * # *
# * # * # * # * #
* # * # * # * # *
# * # * # * # * #
public class loopTest {
public static void main(String[] args) {
for (int i=1;i<=9;i++){ //外层循环控制行数,内层循环控制列数
for (int j = 0; j < 9; j++) {
if ((j+i)%2 == 0) { //if进行判断,如果为奇数则打印“*”,如果为奇数则打印“#”
System.out.print("*\t");
}else{
System.out.print("#\t");
}
}
System.out.println();
}
}
}