Java基礎之If選擇結構

人與電腦玩石頭剪刀布遊戲 1.電腦出哪種,有Math.random()方法來實現 自己定義一下可能出現的情況 2.人會做出的選擇 3.將人與電腦的選擇作比較 //如果人出石頭 if (person.equals(「石頭」)) { if (num == 0) { System.out.println(「電腦出石頭」); System.out.println(「你們平局!」); } else if (
相關文章
相關標籤/搜索