Skip to content

Instantly share code, notes, and snippets.

@tanakaedu
Last active November 4, 2015 04:11
Show Gist options
  • Save tanakaedu/9db56f2727d37443a9b6 to your computer and use it in GitHub Desktop.
Save tanakaedu/9db56f2727d37443a9b6 to your computer and use it in GitHub Desktop.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Random;
public class Janken {
static Random rg = new Random();
public static void main(String[] args) throws Exception {
int comp;
// 0~2までの乱数をint型の変数compに求める
comp=rg.nextInt(3);
// 試しで、変数compを出力する
System.out.print(""+comp);
// Here your code !
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Random;
public class Main {
static Random rg = new Random();
public static void main(String[] args) throws Exception {
int comp;
// 0~2までの乱数をint型の変数compに求める
comp=rg.nextInt(3);
// 試しで、変数compを出力する
System.out.print(""+comp);
// Here your code !
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment