package com.imooc;
public class HelloWorld{
public static void main(String[] args){
int num = 1000000001;
int count = 0;
while(num!=0){
num=num/10;
count++;
}
System.out.println("它是个"+count+"位的数!");
}
public class HelloWorld{
public static void main(String[] args){
int num = 1000000001;
int count = 0;
while(num!=0){
num=num/10;
count++;
}
System.out.println("它是个"+count+"位的数!");
}
public class HelloWorld{
public static void main(String[] args) {
final char Boy='男';
final char Girl='女';
System.out.println(Boy+","+Girl);
}
}
public static void main(String[] args) {
final char Boy='男';
final char Girl='女';
System.out.println(Boy+","+Girl);
}
}
2015-06-02
public class HelloWorld{
public static void main(String[] args) {
String hobby="我爱慕课网";
hobby +="<br>www.imooc.com";
System.out.println(hobby);
}
}
public static void main(String[] args) {
String hobby="我爱慕课网";
hobby +="<br>www.imooc.com";
System.out.println(hobby);
}
}
2015-06-02
three=one+two;
System.out.println("thre=one+two==>"+three);
three+=one;
System.out.println("three+=one==>"+three);
three-=one;
System.out.println("three-=one==>"+three);
three*=one;
System.out.println("three*=one==>"+three);
System.out.println("thre=one+two==>"+three);
three+=one;
System.out.println("three+=one==>"+three);
three-=one;
System.out.println("three-=one==>"+three);
three*=one;
System.out.println("three*=one==>"+three);
2015-06-01
int age=25;
if(age>60){
System.out.println("老年");
}else if(age<=60&age>40){
System.out.println("中年");
}else if(age<=40&age>18){
System.out.println("少年");
}else{System.out.println("童年");
}
if(age>60){
System.out.println("老年");
}else if(age<=60&age>40){
System.out.println("中年");
}else if(age<=40&age>18){
System.out.println("少年");
}else{System.out.println("童年");
}
2015-06-01
int sum=age1+age2+age3+age4;
double avg=sum/4;
int minus=age1-age2;
int newAge=--age1;
System.out.println("年龄总和:"+sum);
System.out.println("平均年龄:"+avg);
System.out.println("年龄差值:"+minus);
System.out.println("自减后的年龄:"+newAge);
}
}
double avg=sum/4;
int minus=age1-age2;
int newAge=--age1;
System.out.println("年龄总和:"+sum);
System.out.println("平均年龄:"+avg);
System.out.println("年龄差值:"+minus);
System.out.println("自减后的年龄:"+newAge);
}
}
2015-06-01