小游戏(石头剪刀布)
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("请输入:");
int a = sc.nextInt();
int random=(int)(Math.random()*3)+1;
System.out.println(random);
boolean i = (a == 1 && random == 3)
|| (a == 2 && random == 1)
||(a == 3 && random == 2);
// a=石头, b=剪刀, c=布。
if (a == random){ //平局
System.out.println("平局");
}else if (i) {
System.out.println("你赢了");
} else {
System.out.println("你输了");
}
R语言编程艺术(1)快速入门
R语言实战(十)处理缺失数据的高级方法
R语言实战(九)主成分和因子分析
R语言实战(八)广义线性模型
R语言实战(七)图形进阶
R语言实战(六)重抽样与自助法
R语言实战(五)方差分析与功效分析
R语言实战(四)回归
R语言实战(三)基本图形与基本统计分析