int score = 53;
int count = 0;
//打印输出加分前成绩
System.out.println("加分前成绩:"+score);
// 只要成绩小于60,就循环执行加分操作,并统计加分次数
while(score<60)
{
score+=1;
count++;
}
System.out.println("加分后成绩:"+score);
System.out.println("共加了:"+count+"次!");
int count = 0;
//打印输出加分前成绩
System.out.println("加分前成绩:"+score);
// 只要成绩小于60,就循环执行加分操作,并统计加分次数
while(score<60)
{
score+=1;
count++;
}
System.out.println("加分后成绩:"+score);
System.out.println("共加了:"+count+"次!");
// 外层循环控制行数
for (int i = 1;i<=3;i++) {
// 内层循环控制每行的*号数
// 内层循环变量的最大值和外层循环变量的值相等
for (int j = 1;j<=i;j++) {
System.out.print("*");
}
// 每打印完一行后进行换行
System.out.println();
}
for (int i = 1;i<=3;i++) {
// 内层循环控制每行的*号数
// 内层循环变量的最大值和外层循环变量的值相等
for (int j = 1;j<=i;j++) {
System.out.print("*");
}
// 每打印完一行后进行换行
System.out.println();
}
2020-10-02
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
System.out.
three+=one;
three-=one;
three*=one;
three/=one;
three%=one;
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
System.out.
three+=one;
three-=one;
three*=one;
three/=one;
three%=one;
2020-09-26