while(num>0){
num=num/10;
count++;
}
System.out.println("它是个" + count + "位的数!");
num=num/10;
count++;
}
System.out.println("它是个" + count + "位的数!");
// 如果当前值大于max,则替换max的值
for (; max < nums[i]; max = nums[i])
// 如果当前值小于min,则替换min的值
for (; min > nums[i]; min = nums[i])
// 累加求和
sum = sum + nums[i];
}
// 求平均值
avg = sum / nums.length;
for (; max < nums[i]; max = nums[i])
// 如果当前值小于min,则替换min的值
for (; min > nums[i]; min = nums[i])
// 累加求和
sum = sum + nums[i];
}
// 求平均值
avg = sum / nums.length;
public class HelloWorld{
public static void main(String [] args){
String wc="我爱王者荣耀";
String _wc="www.wangzherongyao.com";
System.out.println(wc);
System.out.println(_wc);
}
}
public static void main(String [] args){
String wc="我爱王者荣耀";
String _wc="www.wangzherongyao.com";
System.out.println(wc);
System.out.println(_wc);
}
}
2020-11-13
public class HelloWorld{
public static void main(String[] args) {
String hobby="慕课网";
System.out.println(hobby);
}
}
public static void main(String[] args) {
String hobby="慕课网";
System.out.println(hobby);
}
}
String name="爱慕课";
char sex='男';
int num=18;
double price=120.5;
boolean isOK=true;
char sex='男';
int num=18;
double price=120.5;
boolean isOK=true;
2020-11-11
int score = 94;
String sex = "女";
if(score>80){
System.out.println("进入"+sex+"子组决赛");
}else{
System.out.println("fw,爪巴");
}
String sex = "女";
if(score>80){
System.out.println("进入"+sex+"子组决赛");
}else{
System.out.println("fw,爪巴");
}
2020-11-05
public class HelloWorld{
public static void main(String[] args){
long num = 999;
int count = 1;
while( num / 10 != 0 && count<=10){
count +=1;
num /= 10;
}
if(count>=10){
System.out.println("重新输");
}else
System.out.println("它是个"+count+"位的数");
}
}
求个更短的
public static void main(String[] args){
long num = 999;
int count = 1;
while( num / 10 != 0 && count<=10){
count +=1;
num /= 10;
}
if(count>=10){
System.out.println("重新输");
}else
System.out.println("它是个"+count+"位的数");
}
}
求个更短的
int one=10;
int two=20;
int three=0;
three = one + two;
three += one;
three -= one;
three *= one;
three /= one;
three %= one;
System.out.print(three);
int two=20;
int three=0;
three = one + two;
three += one;
three -= one;
three *= one;
three /= one;
three %= one;
System.out.print(three);
2020-10-29