这个就比较有意思了!所有的事情,拆分完之后,都有且只有这三种状态流程!
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
int i = (int)(Math.random()*6)+1;
int j = (int)(Math.random()*6)+1;
int k = (int)(Math.random()*6)+1;
System.out.println(i);
System.out.println(j);
System.out.println(k);
int count = i+j+k;
if(count>15){
System.out.println("运气不错");
}
if(count>=10&&count<15){
System.out.println("运气一般");
}
if(count<10){
System.out.println("运气很差");
}
}
}