package jsu.cn.cyy;
public class Demo10 {
public static void main(String[] srgs){
int week[] = null;
week = new int[7];
for(int i = 0;i < week.length;i++){
week[i]= i + 1;
}
for(int j = 0; j<week.length;j++){
System.out.print("星期:"+week[j]+"");
}
}
}
上述代码使用for循环实现星期一到星期日的实现
package jsu.cn.cyy;
public class Demo12 {public static void main(String[] args){
int rows = 5;
for(int i = 0;i< rows;i++){
for(int j = 0;j <= i;j++){
System.out.println("* ");
}
System.out.println();
}
}
}
原本想打个三角形 但不知为啥是竖着的 明天解密