Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
fortune
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester{ public static void main(String[]args){ int uranai = new java.util.Random().nextInt(4); System.out.println("あなたの運勢を占います!!!"); switch(uranai){ case 1: System.out.println("あなたの運勢は「Super Happy」です!"); break; case 2: System.out.println("あなたの運勢は「Happy」です!"); break; case 3: System.out.println("あなたの運勢は「Good」です。"); break; default: System.out.println("あなたの運勢は「soso...」です。"); } /*改行*/ System.out.println("あなたの運勢を占います!"); int fortune = new java.util.Random().nextInt(4); if (fortune == 1){ System.out.println("あなたの運勢は「大吉」です!"); } else if (fortune == 2){ System.out.println("あなたの運勢は「中吉」です。"); } else if (fortune == 3){ System.out.println("あなたの運勢は「凶」です。。"); } else{ System.out.println("あなたの運勢は「大凶」です!!"); } } }
[
+
]
Show input
Compilation time: 1.45 sec, absolute running time: 0.24 sec, cpu time: 0.23 sec, memory peak: 18 Mb, absolute service time: 1,7 sec
edit mode
|
history
|
discussion
あなたの運勢を占います!!! あなたの運勢は「Good」です。 あなたの運勢を占います! あなたの運勢は「大凶」です!!