// 如果当前值大于max,则替换max的值
if(nums[i]>max)
max=nums[i];
// 如果当前值小于min,则替换min的值
if(nums[i]<min)
min=nums[i];
// 累加求和
sum+=nums[i];
}
// int j=nums.length
// 求平均值
avg=sum/nums.length;
if(nums[i]>max)
max=nums[i];
// 如果当前值小于min,则替换min的值
if(nums[i]<min)
min=nums[i];
// 累加求和
sum+=nums[i];
}
// int j=nums.length
// 求平均值
avg=sum/nums.length;
for (int i=0;i<3;i++)
{
System.out.println(hobbys[i]+'\n');
}
}
}
{
System.out.println(hobbys[i]+'\n');
}
}
}
2015-03-11
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-03-11
public class HelloWorld{
public static void main(String[] args) {
String city="福建";
System.out.println("我的家乡在:"+city);
}
}
public static void main(String[] args) {
String city="福建";
System.out.println("我的家乡在:"+city);
}
}
2015-03-11
public class HelloWorld{
public static void main(String[] args) {
double heightAvg1=176.2;
int heightAvg2=(int)heightAvg1;
System.out.println(heightAvg1);
System.out.println(heightAvg2);
}
}
public static void main(String[] args) {
double heightAvg1=176.2;
int heightAvg2=(int)heightAvg1;
System.out.println(heightAvg1);
System.out.println(heightAvg2);
}
}
2015-03-10