System.out.println("打印直角三角形");
for (int i = 1; i<4;i++ ) {
for (int j = 1; j<=i; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
for (int i = 1; i<4;i++ ) {
for (int j = 1; j<=i; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
2015-08-01
public static void main(String[] args) {
int score = 53;
int count = 0;
System.out.println("加分前成绩" + score );
while(score<60){
count++;
score++;
}
System.out.println("加分后成绩" + score );
System.out.println("一共加了" + count +"次!");
}
int score = 53;
int count = 0;
System.out.println("加分前成绩" + score );
while(score<60){
count++;
score++;
}
System.out.println("加分后成绩" + score );
System.out.println("一共加了" + count +"次!");
}
public class HelloWorld{
public static void main(String[] args) {
int age1=24;
int age2=18;
int age3=36;
int age4=27;
int sum=age1+age2+age3+age4;
float avg=sum/4;
int minus=age1-age2;
int newAge=--age1;
public static void main(String[] args) {
int age1=24;
int age2=18;
int age3=36;
int age4=27;
int sum=age1+age2+age3+age4;
float avg=sum/4;
int minus=age1-age2;
int newAge=--age1;
2015-08-01
public class HelloWorld {
public static void main(String[] args) {
int age=25;
if (age>=18){
System.out.println("成年") ;
}
else
{
System.out.println("未成年");
}
}
}
public static void main(String[] args) {
int age=25;
if (age>=18){
System.out.println("成年") ;
}
else
{
System.out.println("未成年");
}
}
}
2015-07-31
int one = 20 ;
one = one%2;
if(one == 0){
System.out.println("one是偶数");
}
one = one%2;
if(one == 0){
System.out.println("one是偶数");
}
2015-07-31
public class HelloWorld{
public static void main(String[] args){
String hobby="慕课网";
System.out.println(hobby);
String boody="www.imooc.com";
System.out.println(boody);
}
}
public static void main(String[] args){
String hobby="慕课网";
System.out.println(hobby);
String boody="www.imooc.com";
System.out.println(boody);
}
}