public class HelloWorld {
public static void main(String[] args) {
int score = 94;
String sex = "女";
if(score>80){
System.out.println("进入"+sex+"子组决赛");
}
}
}
public static void main(String[] args) {
int score = 94;
String sex = "女";
if(score>80){
System.out.println("进入"+sex+"子组决赛");
}
}
}
2015-04-23
for (int i = 0; i < nums.length; i++) {
if(nums[i]>max){
max=nums[i];
}else if(nums[i]<min){
min=nums[i];
}
sum=sum+nums[i];
}
avg=sum/(nums.length);
if(nums[i]>max){
max=nums[i];
}else if(nums[i]<min){
min=nums[i];
}
sum=sum+nums[i];
}
avg=sum/(nums.length);
public class HelloWorld {
public static void main(String[] args) {
int one = 20 ;
double two = (double)(one%2);
if(two==0){
System.out.println("one是偶数");
}
}
}
public static void main(String[] args) {
int one = 20 ;
double two = (double)(one%2);
if(two==0){
System.out.println("one是偶数");
}
}
}
2015-04-23
public class HelloWorld{
public static void main(String[] args) {
String myStns = "我爱慕课网";
String myNet = "www.imooc.com";
System.out.println(myStns+"\n"+myNet);
}
}
public static void main(String[] args) {
String myStns = "我爱慕课网";
String myNet = "www.imooc.com";
System.out.println(myStns+"\n"+myNet);
}
}
2015-04-23
// 外层循环控制行数
for (int i = 1; i<5; i++ ) {
// 内层循环控制每行的*号数
// 内层循环变量的最大值和外层循环变量的值相等
for (int j = 1; j<i; j++ ) {
System.out.print("*");
}
// 每打印完一行后进行换行
System.out.println();
}
}
}
for (int i = 1; i<5; i++ ) {
// 内层循环控制每行的*号数
// 内层循环变量的最大值和外层循环变量的值相等
for (int j = 1; j<i; j++ ) {
System.out.print("*");
}
// 每打印完一行后进行换行
System.out.println();
}
}
}
2015-04-23