public class HelloWorld
public static void main(String[] args){
int one=20;
if (one%2==0){
System.out.println("one是偶数");
}
}
public static void main(String[] args){
int one=20;
if (one%2==0){
System.out.println("one是偶数");
}
}
2015-05-27
private void TScore(int[] scores) {
Arrays.sort(scores);
System.out.println("考试成绩的前三名为:");
for(int i=scores.length-1,j=0;i>=0&&j<3;i--)
{
if(scores[i]>100||scores[i]<0)
{
continue;
}
System.out.println(scores[i]);
j++;
}
}
Arrays.sort(scores);
System.out.println("考试成绩的前三名为:");
for(int i=scores.length-1,j=0;i>=0&&j<3;i--)
{
if(scores[i]>100||scores[i]<0)
{
continue;
}
System.out.println(scores[i]);
j++;
}
}
public class Hello{
public static void main(String[] args){
int score=68;
String mark=(score>=60)?"及格":"不及格";
System.out.println("考试成绩如何:"+mark);
}
}
public static void main(String[] args){
int score=68;
String mark=(score>=60)?"及格":"不及格";
System.out.println("考试成绩如何:"+mark);
}
}
2015-05-26
public class HelloWorld{
public static void main(String[] args){
int a=18;
int b=18;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
public static void main(String[] args){
int a=18;
int b=18;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
2015-05-26
int there = one + two;
int there1 += one;
int there2 -= one;
int there3 *= one;
int there4 /= one;
int there5 %= one;
System.out.println("there1","there2","there3","there4","there5");
int there1 += one;
int there2 -= one;
int there3 *= one;
int there4 /= one;
int there5 %= one;
System.out.println("there1","there2","there3","there4","there5");
2015-05-26
int a=5;
int b=a++;
System.out.println(a);
System.out.println(b);
运行结果里b可以理解,为什么a=6呢?
int b=a++;
System.out.println(a);
System.out.println(b);
运行结果里b可以理解,为什么a=6呢?
2015-05-26