int sum = age1+age2+age3+age4;
double avg = sum/4;
int minus = age1-age2;
int newAge = --age1;
double avg = sum/4;
int minus = age1-age2;
int newAge = --age1;
2015-08-14
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
int bianLiang=10;
for(int i =1;i<=num;i++){
if(i<10){
count =1;
}
else if(i%bianLiang ==0){
bianLiang *= 10;
count++;
}
}
System.out.println("它是个"+count+"位数");
}
}
public static void main(String[] args){
int num = 999;
int count = 0;
int bianLiang=10;
for(int i =1;i<=num;i++){
if(i<10){
count =1;
}
else if(i%bianLiang ==0){
bianLiang *= 10;
count++;
}
}
System.out.println("它是个"+count+"位数");
}
}
{
public static void main(String[] args) {
boolean a = true; // a同意
boolean b = false; // b反对
boolean c = false; // c反对
boolean d = true; // d同意
System.out.println((a&&b)+"未通过");
System.out.println((a||d)+"通过");
System.out.println((!a)+"未通过");
System.out.println((c^d)+"通过");
public static void main(String[] args) {
boolean a = true; // a同意
boolean b = false; // b反对
boolean c = false; // c反对
boolean d = true; // d同意
System.out.println((a&&b)+"未通过");
System.out.println((a||d)+"通过");
System.out.println((!a)+"未通过");
System.out.println((c^d)+"通过");
2015-08-13
public static void main(String[] args) {
int a=16;
double b=9.5;
String str1="hello";
String str2="imooc";
System.out.println("a等于b:" + (a==b));
System.out.println("a大于b:" + (a>b));
System.out.println("a小于等于b:" + (a<=b));
System.out.println("str1等于str2:" + (str1==str2));
}
}
int a=16;
double b=9.5;
String str1="hello";
String str2="imooc";
System.out.println("a等于b:" + (a==b));
System.out.println("a大于b:" + (a>b));
System.out.println("a小于等于b:" + (a<=b));
System.out.println("str1等于str2:" + (str1==str2));
}
}
2015-08-13
将学习还有练习这种方法结合,先姑且不论老师讲的怎么样(老师讲的还是不错的,就说配置环境变量原来一直都不知道是干嘛用的)这种方法还是很好的。不过还是希望论坛里面能单独出一些题目,后面配答案,这样的话会或许会更好。加油!!
2015-08-13
public class HelloWorld{
public static void main(String[] args) {
//System.out.println("Java");
System.out.println("imooc");
/*System.out.println("Oracle");
System.out.println("MySQL");*/
}
}
public static void main(String[] args) {
//System.out.println("Java");
System.out.println("imooc");
/*System.out.println("Oracle");
System.out.println("MySQL");*/
}
}
2015-08-13